Skip to content

Instantly share code, notes, and snippets.

@narkai
Last active August 29, 2015 14:27
Show Gist options
  • Save narkai/3b4dc09a72f5ee858967 to your computer and use it in GitHub Desktop.
Save narkai/3b4dc09a72f5ee858967 to your computer and use it in GitHub Desktop.
patch spec
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