From bba537a7bebe11be4b1e4a7e126a34cd27b73678 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Sun, 7 May 2017 21:32:52 -0400 Subject: Improve allowed language handling (#2897) * Dont allow empty value in user allowed languages * Sanitize language input to reject blank values in array --- spec/controllers/settings/preferences_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers') diff --git a/spec/controllers/settings/preferences_controller_spec.rb b/spec/controllers/settings/preferences_controller_spec.rb index 432e35cd4..6805a2ce0 100644 --- a/spec/controllers/settings/preferences_controller_spec.rb +++ b/spec/controllers/settings/preferences_controller_spec.rb @@ -18,7 +18,7 @@ describe Settings::PreferencesController do describe 'PUT #update' do it 'updates the user record' do - put :update, params: { user: { locale: 'en', allowed_languages: ['es', 'fr'] } } + put :update, params: { user: { locale: 'en', allowed_languages: ['es', 'fr', ''] } } expect(response).to redirect_to(settings_preferences_path) user.reload -- cgit