diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/admin_public_body_controller_spec.rb | 10 | ||||
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/public_body_spec.rb | 6 |
3 files changed, 12 insertions, 12 deletions
diff --git a/spec/controllers/admin_public_body_controller_spec.rb b/spec/controllers/admin_public_body_controller_spec.rb index 504ddc5cc..289be07df 100644 --- a/spec/controllers/admin_public_body_controller_spec.rb +++ b/spec/controllers/admin_public_body_controller_spec.rb @@ -288,7 +288,7 @@ describe AdminPublicBodyController, "when administering public bodies with i18n" end it "saves edits to a public body" do - PublicBody.with_locale(:es) do + PublicBody.with_locales(:es) do pb = PublicBody.find(id=3) pb.name.should == "El Department for Humpadinking" post :update, { @@ -308,10 +308,10 @@ describe AdminPublicBodyController, "when administering public bodies with i18n" end pb = PublicBody.find(public_bodies(:humpadink_public_body).id) - PublicBody.with_locale(:es) do + PublicBody.with_locales(:es) do pb.name.should == "Renamed" end - PublicBody.with_locale(:en) do + PublicBody.with_locales(:en) do pb.name.should == "Department for Humpadinking" end end @@ -357,12 +357,12 @@ describe AdminPublicBodyController, "when creating public bodies with i18n" do body = PublicBody.find_by_name("New Quango") body.translations.map {|t| t.locale.to_s}.sort.should == ["en", "es"] - PublicBody.with_locale(:en) do + PublicBody.with_locales(:en) do body.name.should == "New Quango" body.url_name.should == "new_quango" body.first_letter.should == "N" end - PublicBody.with_locale(:es) do + PublicBody.with_locales(:es) do body.name.should == "Mi Nuevo Quango" body.url_name.should == "mi_nuevo_quango" body.first_letter.should == "M" diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index 29ece18cb..e97db5a12 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -44,14 +44,14 @@ describe PublicBodyController, "when showing a body" do end it "should assign the body using different locale from that used for url_name" do - PublicBody.with_locale(:es) do + PublicBody.with_locales(:es) do get :show, {:url_name => "dfh", :view => 'all'} assigns[:public_body].notes.should == "Baguette" end end it "should assign the body using same locale as that used in url_name" do - PublicBody.with_locale(:es) do + PublicBody.with_locales(:es) do get :show, {:url_name => "edfh", :view => 'all'} assigns[:public_body].notes.should == "Baguette" end @@ -87,7 +87,7 @@ describe PublicBodyController, "when listing bodies" do end it "should list all bodies from default locale, even when there are no translations for selected locale" do - PublicBody.with_locale(:en) do + PublicBody.with_locales(:en) do @english_only = PublicBody.new(:name => 'English only', :short_name => 'EO', :request_email => 'english@flourish.org', @@ -95,7 +95,7 @@ describe PublicBodyController, "when listing bodies" do :last_edit_comment => '') @english_only.save end - PublicBody.with_locale(:es) do + PublicBody.with_locales(:es) do get :list assigns[:public_bodies].include?(@english_only).should == true end diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index c2e0a6353..127391e79 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -210,7 +210,7 @@ describe PublicBody, "when searching" do end it "should cope with same url_name across multiple locales" do - PublicBody.with_locale(:es) do + PublicBody.with_locales(: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 @@ -231,7 +231,7 @@ end describe PublicBody, " when dealing public body locales" do it "shouldn't fail if it internal_admin_body was created in a locale other than the default" do # first time, do it with the non-default locale - PublicBody.with_locale(:es) do + PublicBody.with_locales(:es) do PublicBody.internal_admin_body end @@ -378,7 +378,7 @@ describe PublicBody, " when loading CSV files" do PublicBody.count.should == original_count + 3 - # XXX Not sure why trying to do a PublicBody.with_locale fails here. Seems related to + # XXX Not sure why trying to do a PublicBody.with_locales fails here. Seems related to # the way categories are loaded every time from the PublicBody class. For now we just # test some translation was done. body = PublicBody.find_by_name('North West Fake Authority') |