Skip to content

Commit ebffc9a

Browse files
committed
Adds a test for hasMany.delAccessor with arguments switched (#320)
1 parent 7146c7d commit ebffc9a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/integration/association-hasmany.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,32 @@ describe("hasMany", function () {
217217
});
218218
});
219219

220+
describe("delAccessor", function () {
221+
before(setup());
222+
223+
it("should accept arguments in different orders", function (done) {
224+
Pet.find({ name: "Mutt" }, function (err, pets) {
225+
Person.find({ name: "John" }, function (err, people) {
226+
should.equal(err, null);
227+
228+
people[0].removePets(function (err) {
229+
should.equal(err, null);
230+
231+
people[0].getPets(function (err, pets) {
232+
should.equal(err, null);
233+
234+
should(Array.isArray(pets));
235+
pets.length.should.equal(1);
236+
pets[0].name.should.equal("Deco");
237+
238+
return done();
239+
});
240+
}, pets[0]);
241+
});
242+
});
243+
});
244+
});
245+
220246
describe("delAccessor", function () {
221247
before(setup());
222248

0 commit comments

Comments
 (0)