aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/public_body_spec.rb
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-06-04 12:15:32 +0100
committerGareth Rees <gareth@mysociety.org>2014-06-06 11:09:09 +0100
commit249a1ef17747deadc773b6474df990d803294c44 (patch)
tree7d02b69ca91fa5f6e88d5f925a13538b32ee39b9 /spec/models/public_body_spec.rb
parentfe3e034cd20cb37d48ef4f3ab2d7c37189000b72 (diff)
Move PublicBody domain logic from controller
Moves the magic 'site_administration' tag logic to the PublicBody model. Easier to make the string passed to `PublicBody#has_tag?` configurable if we want to allow this to be set per install.
Diffstat (limited to 'spec/models/public_body_spec.rb')
-rw-r--r--spec/models/public_body_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb
index 38e31783d..c0842e1c5 100644
--- a/spec/models/public_body_spec.rb
+++ b/spec/models/public_body_spec.rb
@@ -594,6 +594,20 @@ describe PublicBody do
end
+ describe :site_administration? do
+
+ it 'is true when the body has the site_administration tag' do
+ p = FactoryGirl.build(:public_body, :tag_string => 'site_administration')
+ p.site_administration?.should be_true
+ end
+
+ it 'is false when the body does not have the site_administration tag' do
+ p = FactoryGirl.build(:public_body)
+ p.site_administration?.should be_false
+ end
+
+ end
+
end
describe PublicBody, " when override all public body request emails set" do