Adds poll name on admin poll questions index

This commit is contained in:
decabeza
2018-12-19 21:00:09 +01:00
parent d583c93ebf
commit 9c827d6ce0
4 changed files with 27 additions and 6 deletions

View File

@@ -12,13 +12,22 @@ feature 'Admin poll questions' do
%w[title]
scenario 'Index' do
question1 = create(:poll_question)
question2 = create(:poll_question)
poll1 = create(:poll)
poll2 = create(:poll)
question1 = create(:poll_question, poll: poll1)
question2 = create(:poll_question, poll: poll2)
visit admin_questions_path
expect(page).to have_content(question1.title)
expect(page).to have_content(question2.title)
within("#poll_question_#{question1.id}") do
expect(page).to have_content(question1.title)
expect(page).to have_content(poll1.name)
end
within("#poll_question_#{question2.id}") do
expect(page).to have_content(question2.title)
expect(page).to have_content(poll2.name)
end
end
scenario 'Show' do