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

mock_auth doesn't redirect to success url with rspec 3.7.0 #918

Closed
anaumov opened this issue Oct 18, 2017 · 1 comment
Closed

mock_auth doesn't redirect to success url with rspec 3.7.0 #918

anaumov opened this issue Oct 18, 2017 · 1 comment

Comments

@anaumov
Copy link

@anaumov anaumov commented Oct 18, 2017

Configuration

  • Provider Gem: omniauth-1.7.1
  • Ruby Version: 2.4.2p198
  • Framework: rails (5.1.4)
  • Platform: mac

Expected Behavior

When using mock_auth I expect to all requests to twiiter API will redirected to success url immediately.

Actual Behavior

After updating to rspec 3.7.0 mock_auth stops intercept requests to twitter API. It prompt twitter form to user (capybara).

Steps to Reproduce

use rspec 3.7.0 with capybara and omniauth.

@juno
Copy link

@juno juno commented Nov 18, 2017

@anaumov
I faced same issue and it fixed with modify puma config like this:

# config/puma.rb
if  ENV.fetch('RAILS_ENV') { 'development' } == 'test' # Don't use Rails.env
  # Disable cluster mode while test
  workers 0
else
  workers ENV.fetch('WEB_CONCURRENCY') { 2 }
end

Hope this helps.

Updated:
Now, I fetch current Rails env through the environment variable.
Because of puma crashes during boot up in production if puma.rb contains Rails constant.

20:43:52 web.1   |  bundler: failed to load command: puma (/Users/juno/src/qnyp/vendor/bundle/ruby/2.4.0/bin/puma)
20:43:52 web.1   |  NameError: uninitialized constant #<Class:#<Puma::DSL:0x00007fec0c31e8e0>>::Rails
20:43:52 web.1   |    ./config/puma.rb:24:in `_load_from'

Loading

@tmilewski tmilewski closed this Dec 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants