aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-06-11 10:05:28 +0100
committergorm <gormer@gmail.com>2015-06-29 21:32:54 +0200
commita9471ddd30c97db554a8e0dde10417a86fe02c25 (patch)
tree4ed955cd1ae0954bd221e26c7e80c9fd4af80789 /spec/controllers
parentab00e035c8c5978d2a8aea2a914747c22494aa9a (diff)
Move updating of derived attributes to a concern.mimes
Add spec to demonstrate that admin-added bodies aren't getting derived attributes. Add a spec to demonstrate the problem setting the first letter for translations. Demonstrate failure to update derived attributes in translations.
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/admin_public_body_controller_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/controllers/admin_public_body_controller_spec.rb b/spec/controllers/admin_public_body_controller_spec.rb
index 50a373d9d..789a3d3e3 100644
--- a/spec/controllers/admin_public_body_controller_spec.rb
+++ b/spec/controllers/admin_public_body_controller_spec.rb
@@ -128,7 +128,8 @@ describe AdminPublicBodyController, "when creating a public body" do
:last_edit_comment => 'From test code',
:translations_attributes => {
'es' => { :locale => 'es',
- :name => 'Los Quango' }
+ :name => 'Los Quango',
+ :short_name => 'lq' }
} } }
end
@@ -159,6 +160,8 @@ describe AdminPublicBodyController, "when creating a public body" do
I18n.with_locale(:es) do
expect(body.name).to eq('Los Quango')
+ expect(body.url_name).to eq('lq')
+ expect(body.first_letter).to eq('L')
end
end