fixes document specs
This commit is contained in:
@@ -21,7 +21,7 @@ class DirectUpload
|
|||||||
|
|
||||||
#Refactor
|
#Refactor
|
||||||
if @resource.respond_to?(:images) &&
|
if @resource.respond_to?(:images) &&
|
||||||
(@attachment.present? && !@attachment.content_type.match(/pdf/)) || @cached_attachment.present?
|
((@attachment.present? && !@attachment.content_type.match(/pdf/)) || @cached_attachment.present?)
|
||||||
@relation = @resource.images.send("build", relation_attributtes)
|
@relation = @resource.images.send("build", relation_attributtes)
|
||||||
elsif @resource.class.reflections[@resource_relation].macro == :has_one
|
elsif @resource.class.reflections[@resource_relation].macro == :has_one
|
||||||
@relation = @resource.send("build_#{resource_relation}", relation_attributtes)
|
@relation = @resource.send("build_#{resource_relation}", relation_attributtes)
|
||||||
|
|||||||
@@ -191,10 +191,17 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
|||||||
|
|
||||||
documentable_attach_new_file(documentable_factory_name, 0, "spec/fixtures/files/empty.pdf")
|
documentable_attach_new_file(documentable_factory_name, 0, "spec/fixtures/files/empty.pdf")
|
||||||
click_on submit_button
|
click_on submit_button
|
||||||
|
|
||||||
documentable_redirected_to_resource_show_or_navigate_to
|
documentable_redirected_to_resource_show_or_navigate_to
|
||||||
|
|
||||||
expect(page).to have_content "Documents"
|
expect(page).to have_content "Documents"
|
||||||
expect(page).to have_link "empty.pdf"
|
|
||||||
|
find("#tab-documents-label").click
|
||||||
|
expect(page).to have_content "empty.pdf"
|
||||||
|
|
||||||
|
#Review
|
||||||
|
#Doble check why the file is stored with a name different to empty.pdf
|
||||||
|
expect(page).to have_css("a[href$='.pdf']")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Should show resource with new document after successful creation with maximum allowed uploaded files", :js do
|
scenario "Should show resource with new document after successful creation with maximum allowed uploaded files", :js do
|
||||||
|
|||||||
Reference in New Issue
Block a user