Files
nairobi/spec/features
Javier Martín b1996e5694 Check page between AJAX requests in proposals spec.
There was a flaky spec supporting proposals. It's hard to reproduce and
be sure about what was going on, so here is my best guess. Given the
code:

```
within(".proposals-list") { click_link proposal.title }
within("#proposal_#{proposal.id}_votes") { click_link('Support') }
```

The first clicked link generates an AJAX request. Usually, Capybara
would wait for the AJAX request to generate a "Support" link in the
element `#proposal_XX_votes`. However, there's already a
`#proposal_XX_votes` element with a "Support" link on the proposals
index page!

So Capybara doesn't have to wait for the AJAX request to finish before
clicking the "Support" link. From then on, anything can happen.

Another option that works:

```
within(".proposals-list") { click_link proposal.title }
within(".proposal-show #proposal_#{proposal.id}_votes") { click_link('Support') }
```

With this code, the link selector fails on the proposals index page, and
Capybara waits for the AJAX request to finish.

Related to issue #2558.
2018-07-04 00:00:51 +02:00
..
2018-02-09 12:51:15 +01:00
2018-04-09 16:11:06 +02:00
2018-04-04 14:01:51 +02:00
2015-09-13 11:47:57 +02:00
2018-06-08 18:40:07 +02:00
2016-02-08 17:49:03 +01:00
2018-05-22 15:41:10 +02:00