spec/model/node_spec.rb in architect4r-0.4 vs spec/model/node_spec.rb in architect4r-0.4.1

- old
+ new

@@ -28,9 +28,29 @@ person.to_s.should == "#<Person:#{person.object_id} id=#{person.id} name='Morpheus' created_at='#{person.created_at}' human='true' updated_at='#{person.updated_at}' neo4j_uri='#{TEST_SERVER.node_url(person.id)}'>" end end + describe "equality of two instances of the same node" do + + subject { Person.create(:name => 'Alfons', :human => true) } + let(:instance_1) { Person.find_by_id(subject.id) } + let(:instance_2) { Person.find_by_id(subject.id) } + + it "should have the same hash" do + instance_1.hash.should equal(instance_2.hash) + end + + it "should be eql" do + instance_1.should eql(instance_2) + end + + it "should be ==" do + instance_1.should == instance_2 + end + + end + describe "connection" do it { should respond_to(:connection) } its(:connection) { should respond_to(:get) } \ No newline at end of file