rebase and fix test to attach max number of files
This commit is contained in:
@@ -47,19 +47,12 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
scenario "Should show max documents warning when max documents allowed limit is reached", :js do
|
||||
login_as user_to_login
|
||||
visit send(path, arguments)
|
||||
|
||||
documentable.class.max_documents_allowed.times.each do
|
||||
click_link "Add new document"
|
||||
documentable_attach_new_file("spec/fixtures/files/empty.pdf")
|
||||
end
|
||||
|
||||
within "#nested-documents" do
|
||||
find_all(".document input[type=file]", visible: true).each do |document|
|
||||
attach_file(document, "spec/fixtures/files/empty.pdf", make_visible: true)
|
||||
end
|
||||
end
|
||||
|
||||
expect(page).to have_content I18n.t 'documents.buttons.destroy_document'
|
||||
expect(page).to have_css ".max-documents-notice", visible: true
|
||||
expect(page).to have_content 'Remove document'
|
||||
end
|
||||
|
||||
scenario "Should hide max documents warning after any document removal", :js do
|
||||
@@ -70,7 +63,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
click_link "Add new document"
|
||||
end
|
||||
|
||||
all("a", text: "Remove document").last.click
|
||||
all("a", text: "Cancel").last.click
|
||||
|
||||
expect(page).to have_css ".max-documents-notice", visible: false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user