Last active
          August 29, 2015 14:27 
        
      - 
      
 - 
        
Save narkai/3b4dc09a72f5ee858967 to your computer and use it in GitHub Desktop.  
    patch spec
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | patch "/api/v1/users/:id" do | |
| parameter :type, <<-DESC, required: true | |
| Should always be set to <code>users</code>. | |
| DESC | |
| parameter :id, <<-DESC, required: true | |
| The id of the user. | |
| DESC | |
| parameter :name, <<-DESC, scope: :attributes | |
| The name of the user. | |
| DESC | |
| parameter :email, <<-DESC, scope: :attributes | |
| The email of the user. | |
| DESC | |
| parameter :password, <<-DESC, scope: :attributes | |
| The password of the user. | |
| DESC | |
| let(:id) do | |
| @user_id = FactoryGirl.create(:user).id.to_s | |
| end | |
| let(:params) { | |
| { | |
| data: { | |
| type: :users, | |
| id: @user_id, | |
| attributes: { | |
| name: Faker::Name.name | |
| } | |
| } | |
| } | |
| } | |
| let(:raw_post) { params.to_json } | |
| example "Updating a user" do | |
| do_request | |
| expect(status).to eq(200) | |
| end | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment