From e11957a91cb070e6eb86d4202135470a3c5221bc Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 23 Oct 2017 19:56:39 +0200 Subject: [PATCH] adds specs for poll title link --- spec/features/polls/polls_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb index 424787468..8fe23d2ea 100644 --- a/spec/features/polls/polls_spec.rb +++ b/spec/features/polls/polls_spec.rb @@ -59,6 +59,22 @@ feature 'Polls' do expect(page).to have_link('Incoming') expect(page).to_not have_link('Expired') end + + scenario "Poll title link to stats if enabled" do + poll = create(:poll, name: "Poll with stats", stats_enabled: true) + + visit polls_path + + expect(page).to have_link("Poll with stats", href: poll_stats_path(poll)) + end + + scenario "Poll title link to results if enabled" do + poll = create(:poll, name: "Poll with results", stats_enabled: true, results_enabled: true) + + visit polls_path + + expect(page).to have_link("Poll with results", href: poll_results_path(poll)) + end end context 'Show' do