diff options
author | David Cabo <david@calibea.com> | 2011-08-17 11:05:21 +0200 |
---|---|---|
committer | David Cabo <david@calibea.com> | 2011-08-17 11:05:21 +0200 |
commit | 817ce18d16d037aadc5ea44d93854c6e17f06747 (patch) | |
tree | 1820f4a62c1060063e0b9751473eca9610142598 /spec/models/public_body_spec.rb | |
parent | 0ca78b7c2abfe28ef7acd7137fda5d82a973c2e1 (diff) | |
parent | e1a2e1ad36c6b0c7bfac501eb2a0d0ae5efd05a1 (diff) |
Merge branch 'fixes' into asktheeu
Diffstat (limited to 'spec/models/public_body_spec.rb')
-rw-r--r-- | spec/models/public_body_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index ec84cbe65..3d00d37fb 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -210,6 +210,20 @@ describe PublicBody, "when searching" do body.id.should == 3 body.class.to_s.should == 'PublicBody' end + + it "should cope with same url_name across multiple locales" do + PublicBody.with_locale(:es) do + # use the unique spanish name to retrieve and edit + body = PublicBody.find_by_url_name_with_historic('etgq') + body.short_name = 'tgq' # Same as english version + body.save! + + # now try to retrieve it + body = PublicBody.find_by_url_name_with_historic('tgq') + body.id.should == public_bodies(:geraldine_public_body).id + body.name.should == "El A Geraldine Quango" + end + end end describe PublicBody, " when loading CSV files" do |