about summary refs log tree commit diff
path: root/spec/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/settings/preferences_controller_spec.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/controllers/settings/preferences_controller_spec.rb b/spec/controllers/settings/preferences_controller_spec.rb
index 92b626d2d..432e35cd4 100644
--- a/spec/controllers/settings/preferences_controller_spec.rb
+++ b/spec/controllers/settings/preferences_controller_spec.rb
@@ -3,7 +3,7 @@ require 'rails_helper'
 describe Settings::PreferencesController do
   render_views
 
-  let(:user) { Fabricate(:user) }
+  let(:user) { Fabricate(:user, allowed_languages: []) }
 
   before do
     sign_in user, scope: :user
@@ -18,10 +18,12 @@ describe Settings::PreferencesController do
 
   describe 'PUT #update' do
     it 'updates the user record' do
-      put :update, params: { user: { locale: 'en' } }
+      put :update, params: { user: { locale: 'en', allowed_languages: ['es', 'fr'] } }
 
       expect(response).to redirect_to(settings_preferences_path)
-      expect(user.reload.locale).to eq 'en'
+      user.reload
+      expect(user.locale).to eq 'en'
+      expect(user.allowed_languages).to eq ['es', 'fr']
     end
 
     it 'updates user settings' do