Sha256: d0c13181f2305dd5d0e44c98fe119b855bd948a735e7eab11bf17afa37cbc6c4

Contents?: true

Size: 436 Bytes

Versions: 2

Compression:

Stored size: 436 Bytes

Contents

require 'spec_helper'

describe CommentsController, '#index' do
  context 'when model has per_page attribute' do
    it 'overrides WillPaginate default' do
      FactoryGirl.create_list(:comment, 4)
      get :index, format: :json
      expect(response.headers['Link']).to eq("<#{comments_url(page: 2, per_page: 2, format: :json)}>; rel=\"next\", <#{comments_url(page: 2, per_page: 2, format: :json)}>; rel=\"last\"")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
api_pagination_headers-2.0.0 spec/controllers/comments_controller_spec.rb
api_pagination_headers-1.1.2 spec/controllers/comments_controller_spec.rb