Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should have called dataservice.getCustomer fails #130

Open
McGoffmann opened this issue Jul 15, 2017 · 0 comments
Open

should have called dataservice.getCustomer fails #130

McGoffmann opened this issue Jul 15, 2017 · 0 comments

Comments

@McGoffmann
Copy link

Test fails for:
it('with id ' + id, function() {
expect(dataservice.getCustomer).to.have.been.calledWith(id);
});
getCustomer() doesn't appear to get the .withArgs(id)

should have called dataservice.getCustomer
1 time

with id 1017109

AssertionError: expected getCustomer to have been called with arguments 1017109
getCustomer(undefined) => {
$$state: {
pending: undefined,
processScheduled: false,
status: 1,
value: {
city: "Albany",
firstName: "Black",
id: 1017109,
lastName: "Widow",
state: "NY",
thumbnail: "colleen_papa.jpg",
zip: "12205"
}
}
}
at Context. (src/client/app/customers/customer-detail.controller.spec.js:38:66)
expect(dataservice.getCustomer).to.have.been.calledWith(id);

[...]
beforeEach(function() {
sinon.stub(dataservice, 'getCustomer')
.returns($q.when(mockData.blackWidow))
.withArgs(id);
[...]
describe('after activate', function() {
[...]
it('with id ' + id, function() {
expect(dataservice.getCustomer).to.have.been.calledWith(id);
});
[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant