Skip to content

Instantly share code, notes, and snippets.

@narkai
Last active August 29, 2015 14:27
Show Gist options
  • Save narkai/c0a75d4e729a10fab928 to your computer and use it in GitHub Desktop.
Save narkai/c0a75d4e729a10fab928 to your computer and use it in GitHub Desktop.

Revisions

  1. lapico revised this gist Aug 10, 2015. No changes.
  2. lapico revised this gist Aug 10, 2015. No changes.
  3. lapico revised this gist Aug 10, 2015. 1 changed file with 17 additions and 17 deletions.
    34 changes: 17 additions & 17 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -2,35 +2,35 @@ require 'rails_helper'

    describe "users", :type => :request do

    describe 'users#create' do
    describe 'users#create' do

    context "when is successfully created" do

    before(:each) do
    params = {
    data: {
    type: "users",
    attributes: {
    name: "rian",
    email: "[email protected]",
    password: "rody"
    }
    }
    params = {
    data: {
    type: "users",
    attributes: {
    name: "rian",
    email: "[email protected]",
    password: "rody"
    }
    }
    }

    headers = {
    'Content-Type' => "application/vnd.api+json",
    'Accept' => "application/vnd.api+json"
    }

    # post api_v1_users_path, params, headers
    post "/api/v1/users", params, headers
    end
    # post api_v1_users_path, params, headers
    post "/api/v1/users", params, headers
    end

    it "responds with 200" do
    p response
    # expect(response).to be_success
    end
    it "responds with 200" do
    p response
    # expect(response).to be_success
    end

    end

  4. lapico created this gist Aug 10, 2015.
    39 changes: 39 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    require 'rails_helper'

    describe "users", :type => :request do

    describe 'users#create' do

    context "when is successfully created" do

    before(:each) do
    params = {
    data: {
    type: "users",
    attributes: {
    name: "rian",
    email: "[email protected]",
    password: "rody"
    }
    }
    }

    headers = {
    'Content-Type' => "application/vnd.api+json",
    'Accept' => "application/vnd.api+json"
    }

    # post api_v1_users_path, params, headers
    post "/api/v1/users", params, headers
    end

    it "responds with 200" do
    p response
    # expect(response).to be_success
    end

    end

    end

    end