You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JobVacancy::App.controllers:usersdobefore:edit,:updatedoredirect('/login')unlesssigned_in?@user=User.find_by_id(params[:id])redirect('/login')unlesscurrent_user?(@user)endget:edit,:map=>'/users/:id/edit'do@user=User.find_by_id(params[:id])render'users/edit'endput:update,:map=>'/users/:id'do@user=User.find_by_id(params[:id])unless@userflash[:error]="User is not registered in our platform."render'users/edit'endif@user.update_attributes(params[:user])flash[:notice]="You have updated your profile."render'users/edit'elseflash[:error]="Your profile was not updated."render'users/edit'endendend
The spec
require'spec_helper'describe"UsersController"dodescribe"GET edit"dolet(:user){build(:user)}it"render the view for editing a user"doUser.should_receive(:find_by_id).at_least(:once).with(anything()).and_return(user)get"/users/#{user.id}/edit"# I come to this point but the last response is not okay but and routing error, as you can see in the output next to this code examplerequire'pry';binding.prylast_response.shouldbe_okendendend
I even turned of the the csrf protection in config/apps.rb
Padrino.configure_appsdo# enable :sessions# set :session_secret, '6a3ec199b53b002a3bfaf60ec746b9182c095950b41f182790a81a0e36d96884'# set :protection, true# set :protect_from_csrf, trueend
It is working if I run the application.
The text was updated successfully, but these errors were encountered:
MatzFan
added a commit
to MatzFan/job-vacancy
that referenced
this issue
Dec 15, 2014
The controller:
The spec
The output of the
last_response
is:I even turned of the the csrf protection in
config/apps.rb
It is working if I run the application.
The text was updated successfully, but these errors were encountered: