docbrown/spec/system/admin/admin_manages_configuration_spec.rb
Josh Puetz 1c566e0ec4
[deploy] Move /internal to `/admin (#9639)
* First draft - all the big changes

* Changing some more references to 'internal'

* Relocate internal request tests to admin

* Relocate internal system tests to admin

* Fix trailing space

* Test fix

* Move queries from internal to admin

* Docs updates

* Rename internal stimuls controllers to admin (plus docs)

* Rename admin layout

* Fix routing after rebase

* Fixes for latest added admin interfaces

* Serviceworker ignore paths
2020-08-07 10:36:26 -04:00

32 lines
1.1 KiB
Ruby

require "rails_helper"
RSpec.describe "Admin manages configuration", type: :system do
let(:admin) { create(:user, :super_admin) }
before do
sign_in admin
visit admin_config_path
end
# Note: The :meta_keywords are handled slightly differently in the view, so we
# can't check them the same way as the rest.
(VerifySetupCompleted::MANDATORY_CONFIGS - [:meta_keywords]).each do |option|
it "marks #{option} as required" do
selector = "label[for='site_config_#{option}']"
expect(first(selector).text).to include("Required")
end
end
context "when mandatory options are missing" do
it "does not show the banner on the config page" do
allow(SiteConfig).to receive(:tagline).and_return(nil)
expect(page).not_to have_content("Setup not completed yet, please visit the configuration page.")
end
it "does show the banner on other pages" do
allow(SiteConfig).to receive(:tagline).and_return(nil)
visit root_path
expect(page).to have_content("Setup not completed yet, please visit the configuration page.")
end
end
end