From ef0330f671991e76ccc366a4a2f7982b300dd193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 24 Sep 2019 03:21:10 +0200 Subject: [PATCH] Remove duplicate test One test was testing regular users can't access results, and another one was testing neither regular users nor managers can. So the second test can just test the admin scenario, and we're still covering everything. --- spec/features/polls/polls_spec.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb index a8a86951a..415c2eee3 100644 --- a/spec/features/polls/polls_spec.rb +++ b/spec/features/polls/polls_spec.rb @@ -483,7 +483,7 @@ describe "Polls" do expect(page).to have_content("You do not have permission to carry out the action 'stats' on poll.") end - scenario "Do not show poll results or stats if are disabled" do + scenario "Do not show poll results or stats to admins if disabled" do poll = create(:poll, :expired, results_enabled: false, stats_enabled: false) question1 = create(:poll_question, poll: poll) create(:poll_question_answer, question: question1, title: "Han Solo") @@ -491,15 +491,8 @@ describe "Polls" do question2 = create(:poll_question, poll: poll) create(:poll_question_answer, question: question2, title: "Leia") create(:poll_question_answer, question: question2, title: "Luke") - user = create(:user) admin = create(:administrator).user - login_as user - visit poll_path(poll) - - expect(page).not_to have_content("Poll results") - expect(page).not_to have_content("Participation statistics") - login_as admin visit poll_path(poll)