  describe "<%= @resource.uri_partial %>" do
    let(:route) { "<%= @resource.uri_partial %>" }
    <% @resource.methods.each do |method| %>
    describe "<%= method.method.upcase %>" do
      let(:response_body) do<% body = method.responses.first.bodies.first.example.split("\n") %>
        <%= body.join("\n        ").gsub(/\:/, " =>") %>.to_json
      end

      it "<%= method.description.downcase %>" do
        <%= method.method %> route
        expect(last_response.body).to eql response_body
      end

      it "returns status <%= method.responses.first.code %>" do
        <%= method.method %> route
        expect(last_response.status).to eql <%= method.responses.first.code %>
      end
    end<% end %>
  end

  describe "<%= @resource.to_s %>" do
    let(:route) { "<%= @resource.to_s %>" }
    <% @resource.http_methods.each do |method| %>
    describe "<%= method.method.upcase %>" do
      let(:response_body) do<% body = method.responses.first.bodies.first.example.split("\n") %>
        <%= body.join("\n        ").gsub(/\:/, " =>") %>.to_json
      end

      it "<%= method.description.downcase %>" do
        <%= method.method %> route
        expect(last_response.body).to eql response_body
      end

      it "returns status <%= method.responses.first.status_code %>" do
        <%= method.method %> route
        expect(last_response.status).to eql <%= method.responses.first.status_code %>
      end
    end<% end %>
  end

Improve use of RamlModels classes in template
Improve use of RamlModels classes in template
