Fixed language change.

This commit is contained in:
Martin Edenhofer 2015-01-04 22:17:16 +01:00
parent c36993fd18
commit b531b74bf7
3 changed files with 31 additions and 9 deletions

View file

@ -38,7 +38,7 @@ class Index extends App.Controller
id: 'preferences'
type: 'PUT'
url: @apiPath + '/users/preferences'
data: JSON.stringify(params)
data: JSON.stringify({user:params})
processData: true
success: @success
error: @error

View file

@ -509,8 +509,8 @@ curl http://localhost/api/v1/users/preferences.json -v -u #{login}:#{password} -
params[:user].each {|key, value|
current_user.preferences[key.to_sym] = value
}
end
current_user.save
end
render :json => { :message => 'ok' }, :status => :ok
end

View file

@ -47,6 +47,28 @@ class PreferencesTest < TestCase
:area => 'body',
:value => 'Language',
},
{
:execute => 'select',
:css => '.language_item select[name="locale"]',
:value => 'Deutsch',
},
{
:execute => 'click',
:css => '.content button[type="submit"]',
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'Sprache',
},
{
:execute => 'reload',
},
{
:execute => 'watch_for',
:area => 'body',
:value => 'Sprache',
},
],
},
]