Explicitly use rack driver in moderation specs

Just like we mentioned in commit 5f0c422eb, the filter "Mark as viewed"
doesn't work properly, so here's a case where the test would fail with
JavaScript not because the test is wrong, but due to a bug. The test was
passing simplify because there was a typo in the CSS selector, which was
supposed to select an element by ID but didn't have the "#" prefix.

For now we're keeping the test as it was, but eventually we'll have to
fix the bug.
This commit is contained in:
Javi Martín
2021-04-10 14:17:49 +02:00
parent c0c26205e2
commit 16a8e97737
4 changed files with 8 additions and 13 deletions

View File

@@ -85,10 +85,8 @@ describe "Moderate budget investments" do
expect(investment.author).to be_hidden expect(investment.author).to be_hidden
end end
scenario "Ignore the investment" do scenario "Ignore the investment", :no_js do
accept_confirm { click_button "Mark as viewed" } click_button "Mark as viewed"
expect(page).not_to have_css("investment_#{investment.id}")
investment.reload investment.reload

View File

@@ -101,10 +101,9 @@ describe "Moderate comments" do
expect(comment.user).to be_hidden expect(comment.user).to be_hidden
end end
scenario "Ignore the comment" do scenario "Ignore the comment", :no_js do
accept_confirm { click_button "Mark as viewed" } click_button "Mark as viewed"
expect(page).not_to have_css("comment_#{comment.id}")
expect(comment.reload).to be_ignored_flag expect(comment.reload).to be_ignored_flag
expect(comment.reload).not_to be_hidden expect(comment.reload).not_to be_hidden
expect(comment.user).not_to be_hidden expect(comment.user).not_to be_hidden

View File

@@ -74,10 +74,9 @@ describe "Moderate debates" do
expect(debate.author).to be_hidden expect(debate.author).to be_hidden
end end
scenario "Ignore the debate" do scenario "Ignore the debate", :no_js do
accept_confirm { click_button "Mark as viewed" } click_button "Mark as viewed"
expect(page).not_to have_css("debate_#{debate.id}")
expect(debate.reload).to be_ignored_flag expect(debate.reload).to be_ignored_flag
expect(debate.reload).not_to be_hidden expect(debate.reload).not_to be_hidden
expect(debate.author).not_to be_hidden expect(debate.author).not_to be_hidden

View File

@@ -73,10 +73,9 @@ describe "Moderate proposals" do
expect(proposal.author).to be_hidden expect(proposal.author).to be_hidden
end end
scenario "Ignore the proposal" do scenario "Ignore the proposal", :no_js do
accept_confirm { click_button "Mark as viewed" } click_button "Mark as viewed"
expect(page).not_to have_css("proposal_#{proposal.id}")
expect(proposal.reload).to be_ignored_flag expect(proposal.reload).to be_ignored_flag
expect(proposal.reload).not_to be_hidden expect(proposal.reload).not_to be_hidden
expect(proposal.author).not_to be_hidden expect(proposal.author).not_to be_hidden