ruby on rails - devise: cannot login if I have a user controller with a show method -


i'm using devise on rails 3 project , i'm trying bdd using cucumber , rspec.

the problem when go login using cucumber scenario so:

  scenario: login     given not authenticated     , on home page     , have user username "jsmith"     when follow "log in"     , fill in "username" "jsmith"     , fill in "password" "password"     , press "sign in"     should on home page     , should see "logged in successfully."     , should see "log out" 

i run problem when i've got following in routes.rb

  match 'home' => "home#index"    devise_for :users,   :path_names => { :sign_in => 'login', :sign_out => 'logout'}    devise_scope :user     '/login' => 'devise/sessions#create'     '/logout' => 'devise/sessions#destroy'   end    resources :users 

the problem don't see "logged in successfully". if change line in routes.rb

resources :users, :except => [:show] 

then works fine, cannot have show method user then.

is there way around this?

is problem don't see "logged in successfully" or you're not logged in? i'm thinking devise redirects user, if doesn't find goes page... index? - have notice tag , snippet in show page (that should in layout)?

edit

you should check if have session value in show, accomplish put <%= session.to_yaml %> in show, if don't see string 'signed in' guess has been deleted, because you've been redirected.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -