Skip to content

Commit 62a0354

Browse files
author
Marcel Pursche
committed
Merge branch 'master' of github.com:tiagopog/jsonapi-utils into add_render_related_json
2 parents ef41f09 + 54b7900 commit 62a0354

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/controllers/posts_controller_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
expect(data.size).to eq(2)
9595
expect(response).to have_meta_record_count(4)
9696

97+
expect(json.dig('meta', 'page_count')).to be(2)
9798
expect(json.dig('links', 'first')).to be_present
9899
expect(json.dig('links', 'next')).to be_present
99100
expect(json.dig('links', 'last')).to be_present
@@ -109,6 +110,7 @@
109110
expect(data.size).to eq(1)
110111
expect(response).to have_meta_record_count(4)
111112

113+
expect(json.dig('meta', 'page_count')).to be(4)
112114
expect(json.dig('links', 'first')).to be_present
113115
expect(json.dig('links', 'prev')).to be_present
114116
expect(json.dig('links', 'next')).to be_present
@@ -126,6 +128,7 @@
126128

127129
expect(data.size).to eq(1)
128130

131+
expect(json.dig('meta', 'page_count')).to be(4)
129132
expect(json.dig('links', 'first')).to be_present
130133
expect(json.dig('links', 'prev')).to be_present
131134
expect(json.dig('links', 'next')).not_to be_present
@@ -142,6 +145,7 @@
142145
expect(subject).to have_http_status :ok
143146
expect(subject).to have_meta_record_count(4)
144147
expect(data.size).to be <= JSONAPI.configuration.default_page_size
148+
expect(json.dig('meta', 'page_count')).to be(1)
145149
end
146150
end
147151
end

0 commit comments

Comments
 (0)