adds images to anwers

This commit is contained in:
rgarcia
2017-10-04 21:42:57 +02:00
parent 24fc7ab70a
commit 1cf9bc4ad1
10 changed files with 166 additions and 3 deletions

View File

@@ -0,0 +1,31 @@
require 'rails_helper'
feature 'Images' do
background do
admin = create(:administrator)
login_as(admin.user)
end
scenario "Index" do
end
scenario "Create", :js do
question = create(:poll_question)
answer = create(:poll_question_answer, question: question)
visit admin_question_path(question)
within("#poll_question_answer_#{answer.id}") do
click_link "Lista de imágenes"
end
click_link "Add image"
imageable_attach_new_file(:poll_question_answer, "spec/fixtures/files/clippy.jpg")
click_button "Save image"
expect(page).to have_content "Image uploaded successfully"
end
end