Clear changes to settings after checking form saves them (#15746)
* Clear the cached community name before loading new page When the creator settings form had been run before the create new page spec, the community name would be changed from the default "DEV(local)" to "Climbing Life". Since the application helper can memoize this value - and the database will not - ensure these are in sync by clearing the settings cache before requesting the page (which will be prefilled based on the setting). This "fix" should probably be moved into the test introducing the change, rather than the one impacted by it. * Move clearing the settings cache closer to the change Rather than clearing the cache where we were impacted, clear immediately after the save spec completes.
This commit is contained in:
parent
2b34941062
commit
1d26485c36
1 changed files with 7 additions and 0 deletions
|
|
@ -34,6 +34,13 @@ RSpec.describe CreatorSettingsForm, type: :model do
|
|||
describe "#save" do
|
||||
let(:current_user) { create(:user) }
|
||||
|
||||
after do
|
||||
# prevent changes here from leaking into other tests
|
||||
Settings::Community.clear_cache
|
||||
Settings::UserExperience.clear_cache
|
||||
Settings::Authentication.clear_cache
|
||||
end
|
||||
|
||||
# rubocop:disable RSpec/ExampleLength
|
||||
it "saves the updated attributes to the correct Settings values", :aggregate_failures do
|
||||
# NOTE: override the profile migration hack from rails_helper.rb
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue