Some equality tests

@alazier @kspangsege 
> or consistency, a double add to a single Realm should also have added a
copy and the accessor should be reattached to the copy.

A double add to the same Realm will almost always be a user error (we have
had users think they had to re-add the object after each change), so I don't
think it should be allowed (or it should at least give a warning).

Copying objects between realms on the other hand, is quite common.


On Wed, Jul 30, 2014 at 1:06 PM, Kristian Spangsege <
notifications@github.com> wrote:

> In Realm/Tests/ObjectTests.m:
>
> > +
> > +    [realm beginWriteTransaction];
> > +    [realm addObject: obj];
> > +    [realm commitWriteTransaction];
> > +
> > +    XCTAssertFalse([obj isEqual:otherObj], @"One in realm, the other is not.");
> > +    XCTAssertTrue([obj isEqual:[IntObject allObjects][0]], @"Same table and index.");
> > +
> > +    [otherRealm beginWriteTransaction];
> > +    [otherRealm addObject: otherObj];
> > +    [otherRealm commitWriteTransaction];
> > +
> > +    XCTAssertFalse([obj isEqual:otherObj], @"Different realms.");
> > +
> > +    [realm beginWriteTransaction];
> > +    [realm addObject: otherObj];
>
> But a copy of the object also remains in the first Realm, or what? As far
> as I remember, the documentation says nothing about it.
>
> If this is really so, then, for consistency, a double add to a single
> Realm should also have added a copy and the accessor should be reattached
> to the copy.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/realm/realm-cocoa/pull/711/files#r15608412>.
>