Sha256: de0ea0d250ad0531cce8b57a4434b2947304fd120b941f94a8dbafbb45dec212
Contents?: true
Size: 1.19 KB
Versions: 8
Compression:
Stored size: 1.19 KB
Contents
require 'spec_helper' describe RakutenWebService::Response do describe "Pagenate helpers" do let(:resource_class) { double(:resource_class) } subject { RakutenWebService::Response.new(resource_class, json) } context "When page is less than pageCount" do let(:json) do { 'page' => 1, 'pageCount' => 2 } end it { is_expected.to have_next_page } it { is_expected.to_not be_last_page } it { is_expected.to_not have_previous_page } it { is_expected.to be_first_page } end context "When page is equal to pageCount" do let(:json) do { 'page' => 2, 'pageCount' => 2 } end it { is_expected.to_not have_next_page } it { is_expected.to be_last_page } it { is_expected.to have_previous_page } it { is_expected.to_not be_first_page } end context "When current page is in pages" do let(:json) do { 'page' => 2, 'pageCount' => 3 } end it { is_expected.to have_next_page } it { is_expected.to_not be_last_page } it { is_expected.to have_previous_page } it { is_expected.to_not be_last_page } end end end
Version data entries
8 entries across 8 versions & 1 rubygems