diff options
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 6652d8f1f..c61e0c780 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -2573,6 +2573,17 @@ describe RequestController, "#new_batch", :focus => true do response.should redirect_to(info_request_batch_path(new_info_request_batch)) end + it 'should prevent double submission of a batch request' do + params = @default_post_params.merge(:preview => 0) + post :new_batch, params, { :user_id => @user.id } + new_info_request_batch = assigns[:info_request_batch] + response.should redirect_to(info_request_batch_path(new_info_request_batch)) + post :new_batch, params, { :user_id => @user.id } + response.should render_template('new') + assigns[:existing_batch].should_not be_nil + end + + context "when the user is banned" do before do |