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

Fix failing isolated tests #249

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

sinsoku
Copy link
Contributor

@sinsoku sinsoku commented Jun 27, 2020

These tests will fail when run individually, so I fix them.

$ bundle exec rspec spec/controllers/controller_oauth2_spec.rb:118

Failures:

  1) SorceryController with OAuth features when callback_url begin with http:// login_at redirects correctly
     Failure/Error: expect(response).to redirect_to("https://www.facebook.com/v2.2/dialog/oauth?client_id=#{::Sorcery::Controller::Config.facebook.key}&display=page&redirect_uri=http%3A%2F%2Ftest.host%2Foauth%2Ftwitter%2Fcallback&response_type=code&scope=email&state")

       Expected response to be a redirect to <https://www.facebook.com/v2.2/dialog/oauth?client_id=eYVNBjBDi33aa9GkA3w&display=page&redirect_uri=http%3A%2F%2Ftest.host%2Foauth%2Ftwitter%2Fcallback&response_type=code&scope=email&state> but was a redirect to <https://www.facebook.com/dialog/oauth?client_id=eYVNBjBDi33aa9GkA3w&display=page&redirect_uri=http%3A%2F%2Fblabla.com&response_type=code&scope=email&state>.
       Expected "https://www.facebook.com/v2.2/dialog/oauth?client_id=eYVNBjBDi33aa9GkA3w&display=page&redirect_uri=http%3A%2F%2Ftest.host%2Foauth%2Ftwitter%2Fcallback&response_type=code&scope=email&state" to be === "https://www.facebook.com/dialog/oauth?client_id=eYVNBjBDi33aa9GkA3w&display=page&redirect_uri=http%3A%2F%2Fblabla.com&response_type=code&scope=email&state".
     # ./spec/controllers/controller_oauth2_spec.rb:123:in `block (4 levels) in <top (required)>'
$ bundle exec rspec spec/controllers/controller_oauth_spec.rb:86

Failures:

  1) SorceryController SorceryController 'using external API to login' when callback_url begin with http:// login_at redirects correctly FIXED
     Expected pending 'No reason given' to fail. No error was raised.
     # ./spec/controllers/controller_oauth_spec.rb:87

These tests will fail when run individually, so I fix them.

```console
$ bundle exec rspec spec/controllers/controller_oauth2_spec.rb:118

Failures:

  1) SorceryController with OAuth features when callback_url begin with http:// login_at redirects correctly
     Failure/Error: expect(response).to redirect_to("https://www.facebook.com/v2.2/dialog/oauth?client_id=#{::Sorcery::Controller::Config.facebook.key}&display=page&redirect_uri=http%3A%2F%2Ftest.host%2Foauth%2Ftwitter%2Fcallback&response_type=code&scope=email&state")

       Expected response to be a redirect to <https://www.facebook.com/v2.2/dialog/oauth?client_id=eYVNBjBDi33aa9GkA3w&display=page&redirect_uri=http%3A%2F%2Ftest.host%2Foauth%2Ftwitter%2Fcallback&response_type=code&scope=email&state> but was a redirect to <https://www.facebook.com/dialog/oauth?client_id=eYVNBjBDi33aa9GkA3w&display=page&redirect_uri=http%3A%2F%2Fblabla.com&response_type=code&scope=email&state>.
       Expected "https://www.facebook.com/v2.2/dialog/oauth?client_id=eYVNBjBDi33aa9GkA3w&display=page&redirect_uri=http%3A%2F%2Ftest.host%2Foauth%2Ftwitter%2Fcallback&response_type=code&scope=email&state" to be === "https://www.facebook.com/dialog/oauth?client_id=eYVNBjBDi33aa9GkA3w&display=page&redirect_uri=http%3A%2F%2Fblabla.com&response_type=code&scope=email&state".
     # ./spec/controllers/controller_oauth2_spec.rb:123:in `block (4 levels) in <top (required)>'
```

```console
$ bundle exec rspec spec/controllers/controller_oauth_spec.rb:86

Failures:

  1) SorceryController SorceryController 'using external API to login' when callback_url begin with http:// login_at redirects correctly FIXED
     Expected pending 'No reason given' to fail. No error was raised.
     # ./spec/controllers/controller_oauth_spec.rb:87
```
@sinsoku sinsoku force-pushed the fix_failing_isolated_tests branch from 2f9274f to 5691e90 Compare June 28, 2020 03:28
@sinsoku
Copy link
Contributor Author

sinsoku commented Jun 28, 2020

The commit status is not success, but the test is successful in TravisCI.
https://travis-ci.org/github/Sorcery/sorcery/builds/702799910

@joshbuker
Copy link
Member

Seems TravisCI broke again. I know I had to get in there and fix the hooks, might just need to do that again and see what went wrong.

@joshbuker joshbuker merged commit 5d4c2d4 into Sorcery:master Jul 7, 2020
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

Successfully merging this pull request may close these issues.

2 participants