Merge pull request #1922 from joallard/language-toggle

Allow users to toggle interface language in their preferences
This commit is contained in:
Régis Hanol
2014-02-19 18:28:00 +01:00
14 changed files with 77 additions and 1 deletions

View File

@ -44,6 +44,28 @@ describe TopicsController do
end
describe 'set_locale' do
it 'sets the one the user prefers' do
SiteSetting.stubs(:allow_user_locale).returns(true)
user = Fabricate(:user, locale: :fr)
log_in_user(user)
get :show, {topic_id: topic.id}
I18n.locale.should == :fr
end
it 'is sets the default locale when the setting not enabled' do
user = Fabricate(:user, locale: :fr)
log_in_user(user)
get :show, {topic_id: topic.id}
I18n.locale.should == :en
end
end
end
describe 'api' do