diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-01-19 16:29:14 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-01-30 15:00:32 +0000 |
commit | a3dc8ee09b4b0a3661e623ff2665c005fbe8405e (patch) | |
tree | d9a877da51ce62d2fdb36060434ea3bbc2f17102 /app/models | |
parent | b23c9e8ba7fd87c7d41aac785fb5c132031b4d78 (diff) |
Add specs for PublicBody#translated_versions=
Also fixes #empty_translation? to check for String and Symbol keys named
'locale'.
Specs use a pre-change check to assert difference.
For some reason rspec change matcher fails with 'nil is not a symbol'.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/public_body.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index a9cdfeab2..a434cce35 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -153,7 +153,7 @@ class PublicBody < ActiveRecord::Base def translated_versions=(translation_attrs) def empty_translation?(attrs) - attrs_with_values = attrs.select{ |key, value| value != '' and key != 'locale' } + attrs_with_values = attrs.select{ |key, value| value != '' and key.to_s != 'locale' } attrs_with_values.empty? end |