Skip to content

Instantly share code, notes, and snippets.

@bhaskarkotu
Created April 3, 2014 07:25
Show Gist options
  • Save bhaskarkotu/9949790 to your computer and use it in GitHub Desktop.
Save bhaskarkotu/9949790 to your computer and use it in GitHub Desktop.
test case to update user profile
describe 'Update user profile' do
describe 'Update profile of admin' do
it "it updates first_name and password" do
request.accept = "application/json"
post 'create' , @userinfo.merge!(role_name: 'Project manager')
@userinfo = {first_name: 'Sabri', last_name: 'Abarkan', user_id: User.last.id }
put 'update', @userinfo
# @user.reload
result = JSON.parse(response.body)
expect(@userinfo['']).to eq earlier_password
expect(@user.first_name) == 'Robert'
end
end
end
@bhaskarkotu
Copy link
Author

Failure/Error: put 'update', @userinfo
ActionController::UrlGenerationError:
No route matches {:first_name=>"Sabri", :last_name=>"Abarkan", :user_id=>"707", :controller=>"users_admin", :action=>"update"}
# ./spec/controllers/users_admin_controller_spec.rb:110:in `block (4 levels) in <top (required)>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment