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

expectJSON unreliable. #17

Closed
donatj opened this issue Jan 9, 2013 · 2 comments
Closed

expectJSON unreliable. #17

donatj opened this issue Jan 9, 2013 · 2 comments

Comments

@donatj
Copy link
Contributor

donatj commented Jan 9, 2013

The following test fails correctly with the proceeding data set in 0.5.3 but

frisby.create('Requesting the login URL with valid credentials returns a token')
  .auth(setup.user, setup.pass)
  .get(authURL)
  .expectStatus(200)
  .expectJSON({
    result : {
      status: 'error'
    }
  }).inspectJSON()
.toss();

The data set is as follows:

{ status: 'success',
  message: null,
  result: 
   { user_id: '124570',
     token: 'redacted' } }

This erroneously passes for the version npm installs as well as the current master on github, but fails correctly in 0.5.3

@vlucas
Copy link
Owner

vlucas commented Jan 9, 2013

This seems to possibly be related to a change in Jasmine. The matchers are all working correctly, but the return false line inside the custom Frisby matcher is no longer triggering a Jasmine error, so the test still passes. Letting the exception be thrown solves the issue and all the tests work as expected.

Line: https://github.com/vlucas/frisby/blob/master/lib/frisby.js#L808

I will have another update and a fix for this as soon as I can figure out why this isn't happening in the main project I am using Frisby in.

@vlucas
Copy link
Owner

vlucas commented Jan 15, 2013

Fixed in SHA1: 0789385

@vlucas vlucas closed this as completed Jan 15, 2013
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