aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/request_controller_spec.rb10
-rw-r--r--spec/fixtures/info_requests.yml5
2 files changed, 14 insertions, 1 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 9c0997569..bca0a2a57 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -48,7 +48,8 @@ describe RequestController, "when listing all requests" do
end
describe RequestController, "when showing one request" do
- fixtures :info_requests
+ integrate_views
+ fixtures :info_requests, :public_bodies, :users # all needed as integrating views
it "should be successful" do
get :show, :id => 101
@@ -64,6 +65,13 @@ describe RequestController, "when showing one request" do
get :show, :id => 101
assigns[:info_request].should == info_requests(:fancy_dog_request)
end
+
+ it "should show incoming messages" do
+ ir = info_requests(:fancy_dog_request)
+ receive_incoming_mail('incoming-request-plain.email', ir.incoming_email)
+ get :show, :id => 101
+ assigns[:correspondences].size.should == 1
+ end
end
# XXX do this for invalid ids
diff --git a/spec/fixtures/info_requests.yml b/spec/fixtures/info_requests.yml
index 3bb7934ac..53a325caa 100644
--- a/spec/fixtures/info_requests.yml
+++ b/spec/fixtures/info_requests.yml
@@ -3,9 +3,14 @@ fancy_dog_request:
title: Why do you have such a fancy dog?
created_at: 2007-10-11 18:15:57
updated_at: 2007-10-11 18:15:57
+ public_body_id: 2
+ user_id: 1
naughty_chicken_request:
id: 103
title: How much public money is wasted on breeding naughty chickens?
created_at: 2007-10-13 18:15:57
updated_at: 2007-10-13 18:15:57
+ public_body_id: 2
+ user_id: 1
+