Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ActionController::UrlGenerationError:
- No route matches {:action=>"create", :controller=>"user/registrations", :user=>{:name=>"Adriane Koepp", :city=>"Nidiafurt", :address=>"14955 Cormier Viaduct", :country=>"Mozambique", :email=>"moshe@kozey.com", :phone_primary=>"(295) 491-0447 x9108", :phone_secondary=>"536.985.9499 x7264", :postal_code=>"93438-7448", :province=>"South Carolina", :password=>"MaH9R5G8XqB", :pets_attributes=>[{:name=>"Patches", :chip_number=>"149793073311890", :species=>"iusto"}]}}
- it 'creates a new User' do
- expect do
- post :create, params: { user: valid_attributes }
- end.to change(User, :count).by(1)
- end
- devise_for :users, controllers: {
- registration: 'user/registration'
- }
- 1) User::RegistrationsController POST #create with valid params creates a new User
- Failure/Error: post :create, params: { user: valid_attributes }
- AbstractController::ActionNotFound:
- Could not find devise mapping for path "/users".
- This may happen for two reasons:
- 1) You forgot to wrap your route inside the scope block. For example:
- devise_scope :user do
- get "/some/route" => "some_devise_controller"
- end
- 2) You are testing a Devise controller bypassing the router.
- If so, you can explicitly tell Devise which mapping to use:
- @request.env["devise.mapping"] = Devise.mappings[:user]
- # routes.rb
- devise_for :users, controllers: {
- registrations: 'user/registrations'
- }
Add Comment
Please, Sign In to add comment