Git Product home page Git Product logo

Comments (2)

DanielKehoe avatar DanielKehoe commented on September 13, 2024

I've moved the functionality to the file config/initializers/pundit.rb. It extends the ApplicationController. Some developers like to add the code to the Application controller file. Instead, to segregate our Pundit-specific code, we use an initializer file. There's a detailed explanation in my Pundit Tutorial but let me know if you need more information.

Can you say more about the error you got?

from rails-devise-pundit.

lyonsv avatar lyonsv commented on September 13, 2024

I see that you've moved that into an initializer now!

I was getting an error stating authorize is an undefined method on show in the users_controller. However, that was after some editing of of the app that I completed.

I've reverted to my first commit, which was a fresh app composer setup of rails-devise-pundit. On that, I'm getting a lot of errors from Rspec which I've pasted below. When I click through the app, after sign up there's a redirect loop error from the browser. When I type directly into the URL bar after signing up, it will only allow me to access root - /users/{sign_out, 1, 2, etc} all redirect to root.

I'll need to fix this over the next few hours for my own app, but I suspect there's an issue with the composer gem for pundit at the moment...but I might be wrong.


Finished in 1.15 seconds (files took 3.32 seconds to load)
30 examples, 9 failures, 1 pending

Failed examples:

rspec ./spec/features/users/sign_in_spec.rb:11 # Sign in user cannot sign in if not registered
rspec ./spec/features/users/sign_in_spec.rb:21 # Sign in user can sign in with valid credentials
rspec ./spec/features/users/sign_in_spec.rb:32 # Sign in user cannot sign in with wrong email
rspec ./spec/features/users/sign_in_spec.rb:43 # Sign in user cannot sign in with wrong password
rspec ./spec/features/users/sign_out_spec.rb:11 # Sign out user signs out successfully
rspec ./spec/features/users/user_edit_spec.rb:18 # User edit user changes email address
rspec ./spec/features/users/user_show_spec.rb:30 # User profile page user cannot see another user's profile
rspec ./spec/features/visitors/navigation_spec.rb:11 # Navigation links view navigation links
rspec ./spec/features/visitors/sign_up_spec.rb:11 # Sign Up visitor can sign up with valid email address and password

Finished in 1.15 seconds (files took 3.32 seconds to load)
30 examples, 9 failures, 1 pending

from rails-devise-pundit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.