aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/request_controller_spec.rb8
-rw-r--r--spec/fixtures/outgoing_messages.yml16
2 files changed, 22 insertions, 2 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 5758e2b2a..26555aaa0 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -49,7 +49,7 @@ end
describe RequestController, "when showing one request" do
integrate_views
- fixtures :info_requests, :public_bodies, :users, :incoming_messages # all needed as integrating views
+ fixtures :info_requests, :public_bodies, :users, :incoming_messages, :outgoing_messages # all needed as integrating views
it "should be successful" do
get :show, :id => 101
@@ -67,10 +67,14 @@ describe RequestController, "when showing one request" do
end
it "should show incoming messages" do
+ get :show, :id => 101
+ size_before = assigns[:correspondences].size
+
ir = info_requests(:fancy_dog_request)
receive_incoming_mail('incoming-request-plain.email', ir.incoming_email)
+
get :show, :id => 101
- assigns[:correspondences].size.should == 2
+ (assigns[:correspondences].size - size_before).should == 1
end
end
diff --git a/spec/fixtures/outgoing_messages.yml b/spec/fixtures/outgoing_messages.yml
new file mode 100644
index 000000000..db7e24d5f
--- /dev/null
+++ b/spec/fixtures/outgoing_messages.yml
@@ -0,0 +1,16 @@
+useless_outgoing_message:
+ id: 1
+ info_request_id: 101
+ message_type: initial_request
+ status: sent
+ updated_at: 2007-10-12 01:56:58.586598
+ body: "Hi,\r\n\
+ \r\n\
+ Why do you have such a fancy dog?\r\n\
+ \r\n\
+ Thanks!\r\n\
+ \r\n\
+ Francis\r\n"
+ sent_at: 2007-10-25 10:41:12.686264
+ created_at: 2007-10-12 01:56:58.586598
+