Merge pull request #2374 from wairbut-m2c/upload_documents_feature

Upload documents feature
This commit is contained in:
Raimond Garcia
2018-04-05 19:39:12 +02:00
committed by GitHub
7 changed files with 16 additions and 10 deletions

View File

@@ -51,12 +51,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
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
@@ -67,7 +67,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