aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-11-18 15:16:41 +0000
committerGareth Rees <gareth@mysociety.org>2014-11-18 15:16:41 +0000
commitaa44df06a209bd568a1ef51759880f2a2258d6db (patch)
tree9355dbd64068022fe79c8cbc4ec7dbc3e3df41db
parent72865e846ae7eee6116e898c78cf46767f79c596 (diff)
Specs for AdminCensorRuleController#edit
-rw-r--r--spec/controllers/admin_censor_rule_controller_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/admin_censor_rule_controller_spec.rb b/spec/controllers/admin_censor_rule_controller_spec.rb
index 080779c66..9003bbf21 100644
--- a/spec/controllers/admin_censor_rule_controller_spec.rb
+++ b/spec/controllers/admin_censor_rule_controller_spec.rb
@@ -46,6 +46,29 @@ describe AdminCensorRuleController do
end
+ describe 'GET edit' do
+
+ before(:each) do
+ @censor_rule = FactoryGirl.create(:global_censor_rule)
+ end
+
+ it 'returns a successful response' do
+ get :edit, :id => @censor_rule.id
+ expect(response).to be_success
+ end
+
+ it 'renders the correct template' do
+ get :edit, :id => @censor_rule.id
+ expect(response).to render_template('edit')
+ end
+
+ it 'finds the correct censor rule to edit' do
+ get :edit, :id => @censor_rule.id
+ expect(assigns[:censor_rule]).to eq(@censor_rule)
+ end
+
+ end
+
end
describe AdminCensorRuleController, "when making censor rules from the admin interface" do