<commit_before>require 'spec_helper'

describe AdminController do
  before :each do
    fake_admin_login
  end

  after :each do
    I18n.default_locale = :en
  end

  it "should set the given locale as default" do
    put :update, :locale => "fr"
    I18n.default_locale.should == :fr
  end
end
<commit_msg>add test for bug #1674<commit_after>require 'spec_helper'

describe AdminController do
  before :each do
    fake_admin_login
  end

  after :each do
    I18n.default_locale = :en
  end

  it "should set the given locale as default" do
    put :update, :locale => "fr"
    I18n.default_locale.should == :fr
  end

  it "should flash a update message when the system language is changed and affected by language changed " do
    put :update, :locale => "zh"
    flash[:notice].should =="设置成功"
    response.should redirect_to(admin_path)
  end
end

{'fraction_non_alphanumeric': 0.08079625292740047, 'fraction_numerical': 0.01405152224824356, 'mean_word_length': 3.430051813471503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6974793', 'n_tokens_mistral': 288, 'n_tokens_neox': 275, 'n_words': 97}