Make Capybara check the page between comment votes
As pointed out in PR consul#2734: "After clicking the first link, there's an AJAX request which replaces the existing `.in-favor a` and `.against a` links with new elements. So if Capybara tries to click the existing `.against a` link at the same moment it's being replaced, clicking the link won't generate a new request". Making Capybara check the page for new content before clicking the second link solves the problem. This commit solves issues afecting both Madrid's fork and the original CONSUL repo.
This commit is contained in:
@@ -499,6 +499,11 @@ feature 'Commenting legislation questions' do
|
||||
|
||||
within("#comment_#{@comment.id}_votes") do
|
||||
find('.in_favor a').click
|
||||
|
||||
within('.in_favor') do
|
||||
expect(page).to have_content "1"
|
||||
end
|
||||
|
||||
find('.against a').click
|
||||
|
||||
within('.in_favor') do
|
||||
|
||||
@@ -464,6 +464,11 @@ feature 'Commenting proposals' do
|
||||
|
||||
within("#comment_#{@comment.id}_votes") do
|
||||
find('.in_favor a').click
|
||||
|
||||
within('.in_favor') do
|
||||
expect(page).to have_content "1"
|
||||
end
|
||||
|
||||
find('.against a').click
|
||||
|
||||
within('.in_favor') do
|
||||
|
||||
Reference in New Issue
Block a user