diff options
author | Mark Longair <mhl@pobox.com> | 2013-10-04 17:21:49 +0100 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2013-10-04 17:29:06 +0100 |
commit | abfbb63875850922052da6e0626bdba4e137af65 (patch) | |
tree | 27c0e5aa809af213a1096e670cd571b859801323 /spec/controllers/public_body_controller_spec.rb | |
parent | 62c7844025044413158489554e5b6a4c7dc43bb0 (diff) |
Allow public body listing based on first letter outside US-ASCII
Under Ruby 1.8, it was previously impossible to use one of the "first
letter" alphabet links on the public body listing page if the first
letter was outside [A-Za-z] since the test for the parameter only
being a single letter wasn't aware of the possibly of multi-byte
characters. In addition, upcasing of letters outside [A-Za-z] didn't
work because String#upcase in Ruby 1.8 isn't Unicode-aware.
This commit fixes these two problems, so that non-US-ASCII first
letter links will work under Ruby 1.8.
(Fixes #1112.)
Diffstat (limited to 'spec/controllers/public_body_controller_spec.rb')
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |