diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-10-07 10:13:37 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-10-07 10:13:37 +0100 |
commit | 86f1fde1c2ace3e67185368033b3328ad8be83c2 (patch) | |
tree | ce21fc2ab02f28498f55f946aa3a384af234e506 /spec/controllers | |
parent | feae2718b2883fec75a20295c2cddc52f7fa301c (diff) | |
parent | 6a857d9a42629da7c430ddf6c865cb7eb73a8901 (diff) |
Merge remote-tracking branch 'origin/first-letter-unicode-fixes' into rails-3-develop
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/admin_public_body_controller_spec.rb | 3 | ||||
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/spec/controllers/admin_public_body_controller_spec.rb b/spec/controllers/admin_public_body_controller_spec.rb index 8a72db724..fe5087d7c 100644 --- a/spec/controllers/admin_public_body_controller_spec.rb +++ b/spec/controllers/admin_public_body_controller_spec.rb @@ -55,7 +55,8 @@ describe AdminPublicBodyController, "when administering public bodies" do end it "mass assigns tags" do - n = PublicBody.count + condition = "public_body_translations.locale = ?" + n = PublicBody.joins(:translations).where([condition, "en"]).count post :mass_tag_add, { :new_tag => "department", :table_name => "substring" } request.flash[:notice].should == "Added tag to table of bodies." response.should redirect_to(:action=>'list') diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index 2d1b1466f..025ebfdba 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -250,6 +250,13 @@ describe PublicBodyController, "when listing bodies" do response.code.should == '406' end + it "should list authorities starting with a multibyte first letter" do + get :list, {:tag => "å", :show_locale => 'cs'} + response.should render_template('list') + assigns[:public_bodies].should == [ public_bodies(:accented_public_body) ] + assigns[:tag].should == "Å" + end + end describe PublicBodyController, "when showing JSON version for API" do |