Sha256: 3827fad5179c0e93e2805e93e825db3746eed155b4c9f5943273ee049826796b

Contents?: true

Size: 456 Bytes

Versions: 1

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true



describe Grape::Roar do
  include_context 'Grape API App'

  context 'representer' do
    before do
      subject.get('/article/:id') do
        Article.new(title: 'Lonestar', id: params[:id])
      end
    end

    it 'returns a hypermedia representation' do
      get '/article/666'
      expect(last_response.body).to eq '{"title":"Lonestar","id":"666","links":[{"rel":"self","href":"/article/666"}]}'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grape-roar-0.4.1 spec/representer_spec.rb