Sha256: 0300853cddaa6cd4b0e2bb0e53a80a462e6a481a411ea2ae05023faf33dd1c45
Contents?: true
Size: 1.21 KB
Versions: 1
Compression:
Stored size: 1.21 KB
Contents
require 'spec_helper' describe AdamSignals::Response do let(:target_type) { :xmpp } let(:target_address) { 'foo@bar.com' } let(:body) { 'Hello there' } let(:action) { 'greet' } subject { described_class.new target_type: target_type, target_address: target_address, body: body, action: action } its(:target_type) { should == target_type } its(:target_address) { should == target_address } its(:body) { should == body } its(:action) { should == action } it "should be able to encode to and decode from JSON" do subject.should eql(described_class.from_json(subject.to_json)) end describe "equality" do context "with no attributes set" do it "should be equal" do described_class.new.should eql(described_class.new) end end context "with attributes set the same" do it "should be equal" do described_class.new(target_type: :xmpp).should eql(described_class.new(target_type: :xmpp)) end end context "with attributes set differently" do it "should be equal" do described_class.new(target_type: :email).should_not eql(described_class.new(target_type: :xmpp)) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
adam_signals-1.1.0 | spec/adam_signals/response_spec.rb |