spec/ruby/client_spec.rb in faye-0.8.0 vs spec/ruby/client_spec.rb in faye-0.8.1

- old
+ new

@@ -613,9 +613,25 @@ error.code.should == 407 error.params.should == ["/messages/foo"] error.message.should == "Failed to publish" end end + + describe "on receipt of the published message" do + before do + stub_response "channel" => "/messages/foo", + "data" => {"text" => "hi"}, + "clientId" => "fakeid" + end + + it "does not trigger the callbacks" do + published = false + publication = @client.publish("/messages/foo", "text" => "hi") + publication.callback { published = true } + publication.errback { published = true } + published.should be_false + end + end describe "with an outgoing extension installed" do before do extension = Class.new do def outgoing(message, callback)