aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-24 16:41:45 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-24 16:41:45 +0000
commit20119fdc0ce44977c2bb76d8b5329808d62f017f (patch)
tree76a6f9c9aac23ba1fa3db624dbb78683a1f21dc2 /spec/controllers/request_controller_spec.rb
parent7213deb9ebb959b0f5883fce8cf5658e347f0501 (diff)
Fix sporadic test failure
Another contribution to #361.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 6c6ccc76a..18ccbba7e 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -339,14 +339,19 @@ describe RequestController, "when showing one request" do
zipfile = Zip::ZipFile.open(File.join(File.dirname(__FILE__), "../../cache/zips", old_path)) { |zipfile|
zipfile.count.should == 3 # the message plus two "hello.txt" files
}
+
+ # The path of the zip file is based on the hash of the timestamp of the last request
+ # in the thread, so we wait for a second to make sure this one will have a different
+ # timestamp than the previous.
+ sleep 1
receive_incoming_mail('incoming-request-attachment-unknown-extension.email', ir.incoming_email)
get :download_entire_request, :url_title => title
assigns[:url_path].should have_text(/#{title}.zip$/)
+ assigns[:url_path].should_not == old_path
response.location.should have_text(/#{assigns[:url_path]}/)
zipfile = Zip::ZipFile.open(File.join(File.dirname(__FILE__), "../../cache/zips", assigns[:url_path])) { |zipfile|
zipfile.count.should == 5 # the message, two hello.txt, the unknown attachment, and its empty message
}
- assigns[:url_path].should_not == old_path
end
end
end