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.
14 lines
446 B
Ruby
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
|