Added poll questions documents and video specs
New tests to ensure video URL is shown in the admin preview. Also that the video URL and documents are correctly saved after creating a question.
This commit is contained in:
@@ -38,6 +38,7 @@ feature 'Admin poll questions' do
|
||||
Pursued by the Empire's sinister agents, Princess Leia races home aboard her starship, custodian of the stolen plans that can save her
|
||||
people and restore freedom to the galaxy....
|
||||
}
|
||||
video_url = "https://puppyvideos.com"
|
||||
|
||||
visit admin_questions_path
|
||||
click_link "Create question"
|
||||
@@ -45,11 +46,13 @@ feature 'Admin poll questions' do
|
||||
select 'Movies', from: 'poll_question_poll_id'
|
||||
fill_in 'poll_question_title', with: title
|
||||
fill_in 'poll_question_description', with: description
|
||||
fill_in 'poll_question_video_url', with: video_url
|
||||
|
||||
click_button 'Save'
|
||||
|
||||
expect(page).to have_content(title)
|
||||
expect(page).to have_content(description)
|
||||
expect(page).to have_content(video_url)
|
||||
end
|
||||
|
||||
scenario 'Create from successful proposal index' do
|
||||
|
||||
@@ -25,6 +25,25 @@ feature 'Poll Questions' do
|
||||
expect(page).to have_content(question_with_author_visible_name.author_visible_name)
|
||||
end
|
||||
|
||||
scenario '#show view has video_url present' do
|
||||
poll = create(:poll)
|
||||
normal_question = create(:poll_question, poll: poll, video_url: "https://puppyvideos.com")
|
||||
|
||||
visit question_path(normal_question)
|
||||
|
||||
expect(page).to have_link(normal_question.video_url)
|
||||
end
|
||||
|
||||
scenario '#show view has document present' do
|
||||
poll = create(:poll)
|
||||
normal_question = create(:poll_question, poll: poll)
|
||||
document = create(:document, documentable: normal_question)
|
||||
|
||||
visit question_path(normal_question)
|
||||
|
||||
expect(page).to have_link(document.title)
|
||||
end
|
||||
|
||||
context 'Answering' do
|
||||
let(:geozone) { create(:geozone) }
|
||||
let(:poll) { create(:poll, geozone_restricted: true, geozone_ids: [geozone.id]) }
|
||||
|
||||
Reference in New Issue
Block a user