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:
@@ -85,10 +85,8 @@ describe "Moderate budget investments" do
|
||||
expect(investment.author).to be_hidden
|
||||
end
|
||||
|
||||
scenario "Ignore the investment" do
|
||||
accept_confirm { click_button "Mark as viewed" }
|
||||
|
||||
expect(page).not_to have_css("investment_#{investment.id}")
|
||||
scenario "Ignore the investment", :no_js do
|
||||
click_button "Mark as viewed"
|
||||
|
||||
investment.reload
|
||||
|
||||
|
||||
@@ -101,10 +101,9 @@ describe "Moderate comments" do
|
||||
expect(comment.user).to be_hidden
|
||||
end
|
||||
|
||||
scenario "Ignore the comment" do
|
||||
accept_confirm { click_button "Mark as viewed" }
|
||||
scenario "Ignore the comment", :no_js do
|
||||
click_button "Mark as viewed"
|
||||
|
||||
expect(page).not_to have_css("comment_#{comment.id}")
|
||||
expect(comment.reload).to be_ignored_flag
|
||||
expect(comment.reload).not_to be_hidden
|
||||
expect(comment.user).not_to be_hidden
|
||||
|
||||
@@ -74,10 +74,9 @@ describe "Moderate debates" do
|
||||
expect(debate.author).to be_hidden
|
||||
end
|
||||
|
||||
scenario "Ignore the debate" do
|
||||
accept_confirm { click_button "Mark as viewed" }
|
||||
scenario "Ignore the debate", :no_js do
|
||||
click_button "Mark as viewed"
|
||||
|
||||
expect(page).not_to have_css("debate_#{debate.id}")
|
||||
expect(debate.reload).to be_ignored_flag
|
||||
expect(debate.reload).not_to be_hidden
|
||||
expect(debate.author).not_to be_hidden
|
||||
|
||||
@@ -73,10 +73,9 @@ describe "Moderate proposals" do
|
||||
expect(proposal.author).to be_hidden
|
||||
end
|
||||
|
||||
scenario "Ignore the proposal" do
|
||||
accept_confirm { click_button "Mark as viewed" }
|
||||
scenario "Ignore the proposal", :no_js do
|
||||
click_button "Mark as viewed"
|
||||
|
||||
expect(page).not_to have_css("proposal_#{proposal.id}")
|
||||
expect(proposal.reload).to be_ignored_flag
|
||||
expect(proposal.reload).not_to be_hidden
|
||||
expect(proposal.author).not_to be_hidden
|
||||
|
||||
Reference in New Issue
Block a user