Permalink
Browse files

Unifiying to wait for EM in tests

  • Loading branch information...
1 parent 7ad7c70 commit f1d450e30112514ec86d0848d91c7ed15698a4d7 @afcapel committed Jan 25, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 test/integration/push_changes_test.rb
  2. +2 −0 test/integration/push_messages_test.rb
  3. +1 −1 test/models/channel_test.rb
@@ -31,7 +31,7 @@ class ChatPushingTest < ActiveSupport::IntegrationCase
chat.update_attributes! :name => 'A chat about everything'
- sleep(0.5)
+ sleep(0.1)
wait_until(15) do
page.has_content? 'A chat about everything'
@@ -31,6 +31,8 @@ class PushMessagesTest < ActiveSupport::IntegrationCase
end
push :partial => '/shared/message', :to => chat_path
+
+ sleep(0.1)
wait_until 20 do
page.has_content? "#{@user.username} says hola!"
@@ -40,7 +40,7 @@ def setup
assert EM.reactor_running?
- sleep(0.5) # Leave event machine to catch up
+ sleep(0.1) # Leave event machine to catch up
last_message = @connection.messages.last
assert_equal event.to_json, last_message

0 comments on commit f1d450e

Please sign in to comment.