Add images and documents settings to admin panel

This commit is contained in:
Julian Herrero
2019-05-16 16:14:40 +02:00
parent 35cd26c117
commit 220bfb065a
13 changed files with 146 additions and 2 deletions

View File

@@ -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