Sha256: 37729a6705dcaf946a8129240dd3e8c85a4889f82238adf411e91ee237f456d8
Contents?: true
Size: 752 Bytes
Versions: 16
Compression:
Stored size: 752 Bytes
Contents
# frozen_string_literal: true require 'rails_helper' describe Lcms::Engine::Pagination do describe 'params' do it 'has defaults' do pagination = described_class.new({}) expect(pagination.params[:page]).to eq 1 expect(pagination.params[:per_page]).to eq 20 expect(pagination.params[:order]).to eq :asc end it 'filters invalid keys' do pagination = described_class.new page: 3, something: 'else' expect(pagination.params[:page]).to eq 3 expect(pagination.params.keys).to eq %i(page per_page order) end it 'has a strict mode (used for search)' do pagination = described_class.new page: 3 expect(pagination.params(strict: true).keys).to eq %i(page per_page) end end end
Version data entries
16 entries across 16 versions & 1 rubygems