adds specs for poll title link

This commit is contained in:
decabeza
2017-10-23 19:56:39 +02:00
parent da00ac947e
commit e11957a91c

View File

@@ -59,6 +59,22 @@ feature 'Polls' do
expect(page).to have_link('Incoming') expect(page).to have_link('Incoming')
expect(page).to_not have_link('Expired') expect(page).to_not have_link('Expired')
end 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 end
context 'Show' do context 'Show' do