Files
nairobi/spec/models/setting/locales_settings_spec.rb
Javi Martín 0c59c2dfb4 Extract model to handle locales settings
This way we can simplify the view, particularly the form. However, we're
still adding some complexity to the form so inputs are inside labels and
so the collection is easier to style with CSS.
2024-06-05 16:10:56 +02:00

14 lines
446 B
Ruby

require "rails_helper"
describe Setting::LocalesSettings do
describe "#update!" do
it "saves the default locale in the enabled ones when nothing is enabled" do
Setting::LocalesSettings.new.update!(default: "es", enabled: %w[])
updated_locales_settings = Setting::LocalesSettings.new
expect(updated_locales_settings.default).to eq :es
expect(updated_locales_settings.enabled).to match_array [:es]
end
end
end