Fix error messages for question answer images
Since we were creating a new answer in the form, we weren't getting the errors associated to the answer the administrator was trying to create, and so we were skipping the test. Using the answer which contains the information about validation errors fixes the issue and so we don't have to skip the tests.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<div class="poll-question-form">
|
||||
<%= form_for(Poll::Question::Answer.new,
|
||||
<%= form_for(@answer,
|
||||
url: admin_answer_images_path(@answer),
|
||||
method: :post) do |f| %>
|
||||
<%= render "shared/errors", resource: @answer %>
|
||||
|
||||
@@ -119,12 +119,8 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p
|
||||
click_link "Add image"
|
||||
click_on submit_button
|
||||
|
||||
if has_many_images
|
||||
# Pending. Review soon and test
|
||||
else
|
||||
within "#nested-image .image" do
|
||||
expect(page).to have_content("can't be blank", count: 2)
|
||||
end
|
||||
within "#nested-image .image" do
|
||||
expect(page).to have_content("can't be blank", count: 2)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user