diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-10-28 11:41:43 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-12-04 09:32:43 +0000 |
commit | b68c23074b7849b30e8f96ea024ec14ec4b8f324 (patch) | |
tree | cb2eaa9b6ebddc3f07583e2899fcf3bb044d9c92 /spec/controllers/info_request_batch_controller_spec.rb | |
parent | 0fdfad30f1232458ffcd624c893387ce300b49bb (diff) |
Add a rudimentary view for an info request batch.
Diffstat (limited to 'spec/controllers/info_request_batch_controller_spec.rb')
-rw-r--r-- | spec/controllers/info_request_batch_controller_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/controllers/info_request_batch_controller_spec.rb b/spec/controllers/info_request_batch_controller_spec.rb new file mode 100644 index 000000000..b5075c4e0 --- /dev/null +++ b/spec/controllers/info_request_batch_controller_spec.rb @@ -0,0 +1,32 @@ +# coding: utf-8 +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe InfoRequestBatchController, "when showing a request" do + + before do + @info_request_batch = FactoryGirl.create(:info_request_batch, :title => 'Matched title', + :body => 'Matched body') + @first_request = FactoryGirl.create(:info_request, :info_request_batch => @info_request_batch) + @second_request = FactoryGirl.create(:info_request, :info_request_batch => @info_request_batch) + @default_params = {:id => @info_request_batch.id} + end + + def make_request(params=@default_params) + get :show, params + end + + it 'should be successful' do + make_request + response.should be_success + end + + it 'should assign info_requests to the view' do + make_request + assigns[:info_requests].should == [@first_request, @second_request] + end + + it 'should assign an info_request_batch to the view' do + make_request + assigns[:info_request_batch].should == @info_request_batch + end +end |