Merge branch 'master' into dashboard
This commit is contained in:
@@ -56,11 +56,11 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
login_as user_to_login
|
||||
visit send(path, arguments)
|
||||
documentable.class.max_documents_allowed.times.each do
|
||||
documentable_attach_new_file(Rails.root.join('spec/fixtures/files/empty.pdf'))
|
||||
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/empty.pdf"))
|
||||
end
|
||||
|
||||
expect(page).to have_css ".max-documents-notice", visible: true
|
||||
expect(page).to have_content 'Remove document'
|
||||
expect(page).to have_content "Remove document"
|
||||
end
|
||||
|
||||
scenario "Should hide max documents warning after any document removal", :js do
|
||||
@@ -85,7 +85,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
document = find(".document input[type=file]", visible: false)
|
||||
attach_file(
|
||||
document[:id],
|
||||
Rails.root.join('spec/fixtures/files/empty.pdf'),
|
||||
Rails.root.join("spec/fixtures/files/empty.pdf"),
|
||||
make_visible: true
|
||||
)
|
||||
end
|
||||
@@ -98,7 +98,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
login_as user_to_login
|
||||
visit send(path, arguments)
|
||||
|
||||
documentable_attach_new_file(Rails.root.join('spec/fixtures/files/empty.pdf'))
|
||||
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/empty.pdf"))
|
||||
|
||||
expect_document_has_title(0, "empty.pdf")
|
||||
end
|
||||
@@ -115,7 +115,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
document_input = find("input[type=file]", visible: false)
|
||||
attach_file(
|
||||
document_input[:id],
|
||||
Rails.root.join('spec/fixtures/files/empty.pdf'),
|
||||
Rails.root.join("spec/fixtures/files/empty.pdf"),
|
||||
make_visible: true
|
||||
)
|
||||
end
|
||||
@@ -127,7 +127,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
login_as user_to_login
|
||||
visit send(path, arguments)
|
||||
|
||||
documentable_attach_new_file(Rails.root.join('spec/fixtures/files/empty.pdf'))
|
||||
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/empty.pdf"))
|
||||
|
||||
expect(page).to have_css ".loading-bar.complete"
|
||||
end
|
||||
@@ -137,7 +137,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
visit send(path, arguments)
|
||||
|
||||
documentable_attach_new_file(
|
||||
Rails.root.join("spec/fixtures/files/logo_header.gif"),
|
||||
Rails.root.join("spec/fixtures/files/logo_header.png"),
|
||||
false
|
||||
)
|
||||
|
||||
@@ -148,7 +148,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
login_as user_to_login
|
||||
visit send(path, arguments)
|
||||
|
||||
documentable_attach_new_file(Rails.root.join('spec/fixtures/files/empty.pdf'))
|
||||
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/empty.pdf"))
|
||||
|
||||
expect_document_has_cached_attachment(0, ".pdf")
|
||||
end
|
||||
@@ -158,7 +158,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
visit send(path, arguments)
|
||||
|
||||
documentable_attach_new_file(
|
||||
Rails.root.join("spec/fixtures/files/logo_header.gif"),
|
||||
Rails.root.join("spec/fixtures/files/logo_header.png"),
|
||||
false
|
||||
)
|
||||
|
||||
@@ -182,7 +182,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
login_as user_to_login
|
||||
visit send(path, arguments)
|
||||
|
||||
documentable_attach_new_file(Rails.root.join('spec/fixtures/files/empty.pdf'))
|
||||
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/empty.pdf"))
|
||||
click_link "Remove document"
|
||||
|
||||
expect(page).not_to have_css("#nested-documents .document")
|
||||
@@ -205,7 +205,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
visit send(path, arguments)
|
||||
send(fill_resource_method_name) if fill_resource_method_name
|
||||
|
||||
documentable_attach_new_file(Rails.root.join('spec/fixtures/files/empty.pdf'))
|
||||
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/empty.pdf"))
|
||||
click_on submit_button
|
||||
|
||||
expect(page).to have_content documentable_success_notice
|
||||
@@ -219,7 +219,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
visit send(path, arguments)
|
||||
send(fill_resource_method_name) if fill_resource_method_name
|
||||
|
||||
documentable_attach_new_file(Rails.root.join('spec/fixtures/files/empty.pdf'))
|
||||
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/empty.pdf"))
|
||||
click_on submit_button
|
||||
|
||||
documentable_redirected_to_resource_show_or_navigate_to
|
||||
@@ -297,11 +297,11 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
|
||||
describe "When allow attached documents setting is disabled" do
|
||||
before do
|
||||
Setting['feature.allow_attached_documents'] = false
|
||||
Setting["feature.allow_attached_documents"] = false
|
||||
end
|
||||
|
||||
after do
|
||||
Setting['feature.allow_attached_documents'] = true
|
||||
Setting["feature.allow_attached_documents"] = true
|
||||
end
|
||||
|
||||
scenario "Add new document button should not be available" do
|
||||
|
||||
Reference in New Issue
Block a user