Adds create question button to admin proposals show

This commit is contained in:
decabeza
2018-12-19 16:08:57 +01:00
parent 5a027f3a0a
commit aebd29f7e2
5 changed files with 56 additions and 23 deletions

View File

@@ -53,11 +53,12 @@ feature 'Admin poll questions' do
expect(page).to have_content(title)
end
scenario 'Create from successful proposal index' do
scenario 'Create from successful proposal' do
poll = create(:poll, name: 'Proposals')
proposal = create(:proposal, :successful)
visit proposals_path
visit admin_proposal_path(proposal)
click_link "Create question"
expect(page).to have_current_path(new_admin_question_path, ignore_query: true)
@@ -72,17 +73,6 @@ feature 'Admin poll questions' do
expect(page).to have_link(proposal.author.name, href: user_path(proposal.author))
end
scenario "Create from successful proposal show" do
poll = create(:poll, name: 'Proposals')
proposal = create(:proposal, :successful)
visit proposal_path(proposal)
click_link "Create question"
expect(page).to have_current_path(new_admin_question_path, ignore_query: true)
expect(page).to have_field('Question', with: proposal.title)
end
scenario 'Update' do
question1 = create(:poll_question)