spec/qsagi/message_spec.rb in qsagi-0.0.1 vs spec/qsagi/message_spec.rb in qsagi-0.0.2
- old
+ new
@@ -7,18 +7,26 @@
:delivery_details => {:delivery_tag => "tag"},
:payload => "raw_payload"
}
Qsagi::Message.new(data, :parsed_payload).delivery_tag.should == "tag"
end
+
+ it "gracefully handles no delivery details" do
+ Qsagi::Message.new({}, :parsed_payload).delivery_tag.should be_nil
+ end
end
describe "exchange" do
it "returns the exchange" do
data = {
:delivery_details => {:exchange => "the_exchange"},
:payload => "raw_payload"
}
Qsagi::Message.new(data, :parsed_payload).exchange.should == "the_exchange"
+ end
+
+ it "gracefully handles no delivery details" do
+ Qsagi::Message.new({}, :parsed_payload).exchange.should be_nil
end
end
describe "payload" do
it "returns the parsed payload" do