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

add .andFail() option to handleFind() #84

Closed
alexanderjeurissen opened this issue May 13, 2015 · 2 comments
Closed

add .andFail() option to handleFind() #84

alexanderjeurissen opened this issue May 13, 2015 · 2 comments

Comments

@alexanderjeurissen
Copy link
Contributor

I'm currently writing a integration spec for a ember-rails project where I want to test if our notfound a.k.a 404 route is triggered when a resource is requested that does not exist.

this is what I have so far:

test('renders not-found page for nonexisting ids', function () {
  expect(1);

  visit('/products/1');

  testHelper.handleFind('product', {id: "1"});

  andThen(function () {
    expectRouteToBe('not_found'); //custom helper that checks if currentPath() equals X
  });
});

The problem is that I do want to mock the /products/1 endpoint BUT i want it to fail and return a 404. As far as I'm aware off this functionality isn't implemented as of this moment (but I could be wrong).

When I look at the API documentation I see that there is a .andFail option for handleCreate() and handleUpdate() it would be nice to have this option for the handleFind() helper as well.

I'm willing to create a PR for this (including specs), as long as you are interested in this functionality / use-case.

@danielspaniel
Copy link
Collaborator

Sure thing @alexanderjeurissen .. that is a good idea. If you make the PR .. I'll use it.

@danielspaniel
Copy link
Collaborator

version 1.0.10 has andFail method added to handleFind

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

2 participants