diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-12-02 15:44:07 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-12-02 15:44:07 +0000 |
commit | 596b6bf103fac01781913373c1740e95daba57b2 (patch) | |
tree | 0e9fc8d3a9b80df1ead9a3bb3eb85758af391af9 /spec/models | |
parent | 0f39e8201a6541a5cea8a057b40d1977be7f0ddb (diff) |
Always create a the Internal Admin Authority using the default locale. Fixes #303.
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/public_body_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index 09edb395f..07e8f291d 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -226,6 +226,18 @@ describe PublicBody, "when searching" do end 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.internal_admin_body + end + + # second time + lambda {PublicBody.internal_admin_body }.should_not raise_error(ActiveRecord::RecordInvalid) + end +end + describe PublicBody, " when loading CSV files" do before(:each) do # InternalBody is created the first time it's accessed, which happens sometimes during imports, |