require "spec_helper"

describe Endpoints::<%= plural_class_name %> do
  include Committee::Test::Methods
  include Rack::Test::Methods

  def app
    Routes
  end

  it "GET <%= url_path %>" do
    get "<%= url_path %>"
    last_response.status.should eq(200)
    last_response.body.should eq("[]")
  end

  it "POST <%= url_path %>/:id" do
    post "<%= url_path %>"
    last_response.status.should eq(201)
    last_response.body.should eq("{}")
  end

  it "GET <%= url_path %>/:id" do
    get "<%= url_path %>/123"
    last_response.status.should eq(200)
    last_response.body.should eq("{}")
  end

  it "PATCH <%= url_path %>/:id" do
    patch "<%= url_path %>/123"
    last_response.status.should eq(200)
    last_response.body.should eq("{}")
  end

  it "DELETE <%= url_path %>/:id" do
    delete "<%= url_path %>/123"
    last_response.status.should eq(200)
    last_response.body.should eq("{}")
  end
end

require "spec_helper"

describe Endpoints::<%= plural_class_name %> do
  include Committee::Test::Methods
  include Rack::Test::Methods

  def app
    Routes
  end

  describe 'GET <%= url_path %>' do
    it 'returns correct status code and conforms to schema' do
      get '<%= url_path %>'
      last_response.status.should eq(200)
      assert_schema_conform
    end
  end

  describe 'POST <%= url_path %>/:id' do
    it 'returns correct status code and conforms to schema' do
      header "Content-Type", "application/json"
      post '<%= url_path %>', MultiJson.encode({})
      last_response.status.should eq(201)
      assert_schema_conform
    end
  end

  describe 'GET <%= url_path %>/:id' do
    it 'returns correct status code and conforms to schema' do
      get "<%= url_path %>/123"
      last_response.status.should eq(200)
      assert_schema_conform
    end
  end

  describe 'PATCH <%= url_path %>/:id' do
    it 'returns correct status code and conforms to schema' do
      header "Content-Type", "application/json"
      patch '<%= url_path %>/123', MultiJson.encode({})
      last_response.status.should eq(200)
      assert_schema_conform
    end
  end

  describe 'DELETE <%= url_path %>/:id' do
    it 'returns correct status code and conforms to schema' do
      delete '<%= url_path %>/123'
      last_response.status.should eq(200)
      assert_schema_conform
    end
  end
end

Add grouping to acceptance spec
Add grouping to acceptance spec
