test/test_jabber.rb in messenger-0.1.0 vs test/test_jabber.rb in messenger-0.1.1

- old
+ new

@@ -12,22 +12,25 @@ end should "send a successful jabber message" do ::Jabber::Simple.expects(:new).with("notifier@zencoder.com", "asdfasdf", nil).returns(@successful_jabber) result = Jabber.send("jabber://brandon@zencoder.com", "Test message", :jabber_id => "notifier@zencoder.com", :jabber_password => "asdfasdf") - assert_equal [true, nil], result + assert result.success? + assert_nil result.response end should "determine and set the jabber host" do ::Jabber::Simple.expects(:new).with("notifier@zencoder.com", "asdfasdf", "host.com").returns(@successful_jabber) result = Jabber.send("jabber://brandon@zencoder.com/host.com", "Test message", :jabber_id => "notifier@zencoder.com", :jabber_password => "asdfasdf") - assert_equal [true, nil], result + assert result.success? + assert_nil result.response end should "fail if the recipient is not subscribed" do ::Jabber::Simple.expects(:new).with("notifier@zencoder.com", "asdfasdf", nil).returns(@failed_jabber) result = Jabber.send("jabber://brandon@zencoder.com", "Test message", :jabber_id => "notifier@zencoder.com", :jabber_password => "asdfasdf") - assert_equal [false, "Not yet authorized"], result + assert_equal false, result.success? + assert_equal "Not yet authorized", result.response end should "raise when sending to an invalid URL" do assert_raises URLError do Jabber.send("jabber://", :jabber_id => "asdf", :jabber_password => "asdf")