When I use rspec: Invalid route name, already in use: 'root' (ArgumentError)

前端 未结 1 674
一整个雨季
一整个雨季 2021-01-16 13:32

When I use rspec to do some testing: bundle exec rspec spec/ terminal throws this error to me. But in my route.rb, I think I only define one root path



        
相关标签:
1条回答
  • 2021-01-16 13:49

    These two named routes:

    match '/signin',  to: 'sessions#new',         via: 'get'  
    match '/signout', to: 'sessions#destroy',     via: 'delete'
    

    are overriding the routes set up with:

    resources :sessions, only: [:new, :create, :destroy] 
    

    Change that line to:

    resources :sessions, only: [:create] 
    

    assuming that you even need that route.

    0 讨论(0)
提交回复
热议问题