aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-06-02 17:03:25 +0100
committerLouise Crow <louise.crow@gmail.com>2014-06-02 17:03:25 +0100
commitbe5e24bc207bc3306ccbb2104e3cf26002469b1d (patch)
treeafa4fbddfcc4f37735dab72ec6f8e915f8220477 /spec/controllers/request_controller_spec.rb
parentc38327f35a5203a90c9f9084c16da2700d96726a (diff)
parent21e17c404bfd4ab900045589a751c7010e223609 (diff)
Merge branch 'issues/1448-no-error-on-spam' into rails-3-develop
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 9353efcb3..070511fb0 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -1007,6 +1007,17 @@ describe RequestController, "when creating a new request" do
# post_redirect.post_params.should == params # XXX get this working. there's a : vs '' problem amongst others
end
+ it 'redirects to the frontpage if the action is sent the invalid
+ public_body param' do
+ post :new, :info_request => { :public_body => @body.id,
+ :title => 'Why Geraldine?',
+ :tag_string => '' },
+ :outgoing_message => { :body => 'This is a silly letter.' },
+ :submitted_new_request => 1,
+ :preview => 1
+ response.should redirect_to frontpage_url
+ end
+
it "should show preview when input is good" do
session[:user_id] = @user.id
post :new, { :info_request => { :public_body_id => @body.id,