Add images and documents settings to admin panel
This commit is contained in:
@@ -98,6 +98,40 @@ describe "Admin settings" do
|
||||
|
||||
end
|
||||
|
||||
describe "Update content types" do
|
||||
|
||||
scenario "stores the correct mime types" do
|
||||
setting = Setting.create(key: "upload.images.content_types", value: "image/png")
|
||||
admin = create(:administrator).user
|
||||
login_as(admin)
|
||||
visit admin_settings_path
|
||||
find("#images-and-documents-tab").click
|
||||
|
||||
within "#edit_setting_#{setting.id}" do
|
||||
expect(find("#png")).to be_checked
|
||||
expect(find("#jpg")).not_to be_checked
|
||||
expect(find("#gif")).not_to be_checked
|
||||
|
||||
check "gif"
|
||||
|
||||
click_button "Update"
|
||||
end
|
||||
|
||||
expect(page).to have_content "Value updated"
|
||||
expect(Setting["upload.images.content_types"]).to include "image/png"
|
||||
expect(Setting["upload.images.content_types"]).to include "image/gif"
|
||||
|
||||
visit admin_settings_path(anchor: "tab-images-and-documents")
|
||||
|
||||
within "#edit_setting_#{setting.id}" do
|
||||
expect(find("#png")).to be_checked
|
||||
expect(find("#gif")).to be_checked
|
||||
expect(find("#jpg")).not_to be_checked
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "Skip verification" do
|
||||
|
||||
scenario "deactivate skip verification", :js do
|
||||
|
||||
Reference in New Issue
Block a user