spec/paginate/base_spec.rb in paginate-3.0.0 vs spec/paginate/base_spec.rb in paginate-4.0.0

- old
+ new

@@ -18,26 +18,26 @@ it "returns page from options" do expect(Paginate::Base.new(scope, page: 12).page).to eql(12) end it "returns limit from configuration" do - Paginate::Config.size = 25 + Paginate.configuration.size = 25 expect(Paginate::Base.new(scope).limit).to eql(26) end it "returns limit from options" do - Paginate::Config.size = 25 + Paginate.configuration.size = 25 expect(Paginate::Base.new(scope, size: 13).limit).to eql(14) end it "returns default limit" do - Paginate::Config.size = nil + Paginate.configuration.size = nil expect(Paginate::Base.new(scope).limit).to eql(11) end it "returns offset from configuration" do - Paginate::Config.size = 15 + Paginate.configuration.size = 15 expect(Paginate::Base.new(scope, page: 2).offset).to eql(15) end it "returns offset from options" do expect(Paginate::Base.new(scope, page: 2, size: 5).offset).to eql(5) @@ -49,22 +49,22 @@ expect(actual).to eql(expected) end specify { - Paginate::Base.new(scope, page: 1, size: 5, collection: Array.new(6)) - .should have_next_page + expect(Paginate::Base.new(scope, page: 1, size: 5, collection: Array.new(6))) + .to have_next_page } specify { - Paginate::Base.new(scope, page: 1, size: 5, collection: Array.new(5)) - .should_not have_next_page + expect(Paginate::Base.new(scope, page: 1, size: 5, collection: Array.new(5))) + .not_to have_next_page } specify { - Paginate::Base.new(scope, page: 2).should have_previous_page + expect(Paginate::Base.new(scope, page: 2)).to have_previous_page } specify { - Paginate::Base.new(scope, page: 1).should_not have_previous_page + expect(Paginate::Base.new(scope, page: 1)).not_to have_previous_page } end