spec/grape/pagy_spec.rb in grape-pagy-0.3.0 vs spec/grape/pagy_spec.rb in grape-pagy-0.3.1
- old
+ new
@@ -3,11 +3,11 @@
describe Grape::Pagy do
include Rack::Test::Methods
let(:app) { TestAPI }
- it 'should paginate' do
+ it 'paginates' do
get '/'
expect(last_response.status).to eq(200)
expect(last_response.headers).to include(
'Current-Page' => '1',
'Link' => %(<http://example.org/?page=1>; rel="first", <http://example.org/?page=2>; rel="next", <http://example.org/?page=3>; rel="last"),
@@ -16,11 +16,11 @@
'Total-Pages' => '3',
)
expect(last_response.body).to eq(%([1, 2, 3, 4, 5]))
end
- it 'should accept page and items parameters' do
+ it 'accepts page and items parameters' do
get '/?page=2&items=3'
expect(last_response.status).to eq(200)
expect(last_response.headers).to include(
'Current-Page' => '2',
'Page-Items' => '3',
@@ -28,31 +28,31 @@
'Total-Pages' => '4',
)
expect(last_response.body).to eq(%([4, 5, 6]))
end
- it 'should cap items' do
+ it 'caps items' do
get '/?items=10'
expect(last_response.headers).to include('Page-Items' => '6')
expect(last_response.body).to eq(%([1, 2, 3, 4, 5, 6]))
get '/?items=3'
expect(last_response.headers).to include('Page-Items' => '3')
expect(last_response.body).to eq(%([1, 2, 3]))
end
- it 'should ignore overflow' do
+ it 'ignores overflow' do
get '/?page=99'
expect(last_response.status).to eq(200)
expect(last_response.headers).to include(
'Current-Page' => '99',
'Total-Pages' => '3',
)
expect(last_response.body).to eq(%([]))
end
- it 'should allow countless mode' do
+ it 'allows countless mode' do
get '/countless?page=2'
expect(last_response.status).to eq(200)
expect(last_response.headers).to include(
'Current-Page' => '2',
'Page-Items' => '3',
@@ -67,10 +67,10 @@
'Total-Pages',
)
expect(last_response.body).to eq(%([4, 5, 6]))
end
- it 'should inherit helper' do
+ it 'inherits helper' do
get '/sub'
expect(last_response.status).to eq(200)
expect(last_response.headers).to include(
'Current-Page' => '1',
'Page-Items' => '10',