aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-09-24 23:49:21 +0200
committerDavid Cabo <david@calibea.com>2011-09-24 23:49:21 +0200
commit1765df854dd8b37d5d029a95d48edd988c7b5796 (patch)
treeb2d6fedd38b52a63ba1600f8bda02384e5d5ef05 /spec/models
parent08a358e5cdc9e9dfc89ac962c85f4cfa3c5ff204 (diff)
Check against default locale more robustly when importing public bodies. Fixes #193
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/public_body_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb
index 96a783743..33ab8ffdb 100644
--- a/spec/models/public_body_spec.rb
+++ b/spec/models/public_body_spec.rb
@@ -377,7 +377,10 @@ describe PublicBody, " when loading CSV files" do
original_count = PublicBody.count
csv_contents = load_file_fixture("fake-authority-type-with-field-names.csv")
- errors, notes = PublicBody.import_csv(csv_contents, '', 'replace', true, 'someadmin', [:en, :xx]) # true means dry run
+ # Depending on the runtime environment (Ruby version? OS?) the list of available locales
+ # is made of strings or symbols, so we use 'en' here as a string to test both scenarios.
+ # See https://github.com/sebbacon/alaveteli/issues/193
+ errors, notes = PublicBody.import_csv(csv_contents, '', 'replace', true, 'someadmin', ['en', :xx]) # true means dry run
errors.should == []
notes.size.should == 4
notes.should == [