test/services/publisher_test.rb in propono-1.1.1 vs test/services/publisher_test.rb in propono-1.1.2
- old
+ new
@@ -110,11 +110,12 @@
def test_publish_via_sns_should_propogate_exception_on_topic_creation_error
TopicCreator.stubs(:find_or_create).raises(TopicCreatorError)
assert_raises(TopicCreatorError) do
publisher = Publisher.new("topic", "message")
- publisher.send(:publish_via_sns)
+ thread = publisher.send(:publish_via_sns)
+ thread.join
end
end
def test_publish_via_sns_creates_a_topic
topic_id = "Malcs_topic_id"
@@ -124,11 +125,13 @@
TopicCreator.expects(:find_or_create).with(topic_id).returns(topic)
sns = mock()
sns.stubs(:publish)
publisher = Publisher.new(topic_id, "Foobar")
+ publisher.stubs(sns: sns)
- publisher.send(:publish_via_sns)
+ thread = publisher.send(:publish_via_sns)
+ thread.join
end
def test_udp_uses_correct_message_host_and_port
host = "http://meducation.net"
port = 1234