test/test_campfire.rb in messenger-0.1.0 vs test/test_campfire.rb in messenger-0.1.1
- old
+ new
@@ -12,16 +12,18 @@
end
should "post a successful message" do
HTTParty.expects(:post).with("http://subdomain.campfirenow.com/room/room/speak.json", :basic_auth => { :username => 'api', :password => 'x' }, :body => '{"message":{"body":"content"}}', :headers => { "Content-Type" => "application/json" }).returns(@success_response)
result = Campfire.send("campfire://api:room@subdomain.campfirenow.com", 'content')
- assert_equal [true, @success_response], result
+ assert result.success?
+ assert_equal @success_response, result.response
end
should "post a failed message" do
HTTParty.expects(:post).with("http://subdomain.campfirenow.com/room/room/speak.json", :basic_auth => { :username => 'api', :password => 'x' }, :body => '{"message":{"body":"content"}}', :headers => { "Content-Type" => "application/json" }).returns(@failure_response)
result = Campfire.send("campfire://api:room@subdomain.campfirenow.com", 'content')
- assert_equal [false, @failure_response], result
+ assert_equal false, result.success?
+ assert_equal @failure_response, result.response
end
should "raise when sending to an invalid URL" do
assert_raises URLError do
Campfire.send("campfire://missing_room@subdomain.campfirenow.com", 'content')