Sha256: 9516993ce120456bbeed166cb036e17b022fdbe735382aa9c2d3d35731577114

Contents?: true

Size: 1.83 KB

Versions: 1

Compression:

Stored size: 1.83 KB

Contents

require "spec_helper"

module <%= module_name %>
  describe "<%= action_type.upcase %> api/v1/<%= full_name %>" do

    # ==========================================================================
    # Prepare context
    # ==========================================================================

    # let!(:something) { something }

    # ==========================================================================
    # Prepare variables
    # ==========================================================================

    # let!(:params) { { "something" => something } }

    # def call_request(params)
    #   <%= action_type %> "<%= gem_name %>/api/v1/<%= escaped_name %>", params
    # end

    # ==========================================================================
    # Run tests
    # ==========================================================================

    # context "with proper params" do

    #   before { call_request params }

    #   it "changes something" do
    #     expect(something).to eq something
    #   end

    #   it "responds with 200" do
    #     expect(response.status).to eq 200
    #   end

    #   it "receives proper json" do
    #     expect(response.body).to match_json_schema(:something)
    #   end

    #   it "receives something" do
    #     something = JSON.parse(response.body)["something"]
    #     expect(something).to eq something
    #   end
    # end

    # context "with wrong params" do
    #
    #   before { params["something"] = something }
    #   before { call_request params }

    #   it "doesn't change something" do
    #     expect(something).to eq something
    #   end

    #   it "responds with 400" do
    #     expect(response.status).to eq 400
    #   end

    #   it "receives proper json" do
    #     expect(response.body).to match_json_schema(:get_errors)
    #   end
    # end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hexx-1.1.1 lib/generators/request/templates/request_spec.erb