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

Rspec / Capybara #83

Open
ddavisgraphics opened this issue Aug 3, 2018 · 2 comments
Open

Rspec / Capybara #83

ddavisgraphics opened this issue Aug 3, 2018 · 2 comments

Comments

@ddavisgraphics
Copy link

I think I'm getting this error because of fake cas. The URI and routes work on the local application, it works when testing the routes themselves, and I get 302 redirects in request tests. However the way to test in a feature test which is depicted in the documentation is not working.

  1) Admins requires to be signed in as an admin
     Failure/Error: visit '/login'

     URI::InvalidURIError:
       bad URI(is not URI?):
     # /usr/local/bundle/gems/capybara-3.4.1/lib/capybara/rack_test/browser.rb:59:in `process'
     # /usr/local/bundle/gems/capybara-3.4.1/lib/capybara/rack_test/browser.rb:51:in `block in process_and_follow_redirects'
     # /usr/local/bundle/gems/capybara-3.4.1/lib/capybara/rack_test/browser.rb:46:in `times'
     # /usr/local/bundle/gems/capybara-3.4.1/lib/capybara/rack_test/browser.rb:46:in `process_and_follow_redirects'
     # /usr/local/bundle/gems/capybara-3.4.1/lib/capybara/rack_test/browser.rb:23:in `visit'
     # /usr/local/bundle/gems/capybara-3.4.1/lib/capybara/rack_test/driver.rb:45:in `visit'
     # /usr/local/bundle/gems/capybara-3.4.1/lib/capybara/session.rb:269:in `visit'
     # /usr/local/bundle/gems/capybara-3.4.1/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
     # ./spec/features/admins_spec.rb:6:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `to_str' for nil:NilClass
     #   /usr/local/bundle/gems/capybara-3.4.1/lib/capybara/rack_test/browser.rb:59:in `process'
@adamcrown
Copy link
Collaborator

Hi @ddavisgraphics. Sorry for the very long delay in getting back to you on this. I'm gonna try to stay on top of these things better going forward. Are you still having this problem? If you could provide the code that's failing in that admins_spec.rb file, that would be helpful. Thanks.

@ddavisgraphics
Copy link
Author

Looking back at the code, it appears that we skipped testing for the test environment because we couldn't get a mock authentication to work.

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