Remove new_nested action from images controller. Use cocoon gem to manage new nested fields creation on images.

This commit is contained in:
Senén Rodero Rodríguez
2017-09-23 17:14:32 +02:00
parent 88a7a29d27
commit f8d78ec4ab
23 changed files with 263 additions and 268 deletions

View File

@@ -159,6 +159,8 @@ shared_examples "imageable" do |imageable_factory_name, imageable_path, imageabl
attach_image("spec/fixtures/files/clippy.jpg", true)
expect(page).to have_selector ".loading-bar.complete"
expect(page).to have_css("figure img")
expect(page).not_to have_css("figure figcaption")
end
@@ -342,7 +344,9 @@ shared_examples "imageable" do |imageable_factory_name, imageable_path, imageabl
end
def attach_image(path, success = true)
attach_file :image_attachment, path, make_visible: true
image = find(".image")
image_input = image.find("input[type=file]", visible: false)
attach_file image_input[:id], path, make_visible: true
if success
expect(page).to have_css ".loading-bar.complete"
else