Created
April 3, 2014 07:25
-
-
Save bhaskarkotu/9949790 to your computer and use it in GitHub Desktop.
test case to update user profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)>'