Skip to content

Commit ae11179

Browse files
Simplify test
1 parent 7352136 commit ae11179

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

spec/paginator_spec.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@
33
require "spec_helper"
44
require "seam/paginator"
55

6-
# Integration tests for Paginator using the fake Seam Connect server
76
RSpec.describe Seam::Paginator do
8-
# Use the helper to run a fake server and get a configured client
97
around do |example|
108
with_fake_seam_connect do |seam, _endpoint, _seed|
11-
@seam = seam # Store seam client for use in tests
9+
@seam = seam
1210
example.run
1311
end
1412
end
1513

16-
let(:seam) { @seam } # Make seam client available via let
17-
18-
# The default seed in fake-seam-connect creates 3 connected accounts.
19-
let(:total_accounts) { 3 }
14+
let(:seam) { @seam }
2015

2116
describe "#first_page" do
2217
it "fetches the first page of results and pagination info" do
@@ -61,6 +56,7 @@
6156

6257
describe "#flatten_to_list" do
6358
it "fetches all items from all pages into a single list" do
59+
total_accounts = seam.connected_accounts.list.size
6460
paginator = seam.create_paginator(seam.connected_accounts.method(:list), {limit: 1})
6561
paginated_accounts = paginator.flatten_to_list
6662

@@ -73,6 +69,7 @@
7369

7470
describe "#flatten" do
7571
it "returns an Enumerator that yields all items from all pages" do
72+
total_accounts = seam.connected_accounts.list.size
7673
paginator = seam.create_paginator(seam.connected_accounts.method(:list), {limit: 1})
7774
enumerator = paginator.flatten
7875

0 commit comments

Comments
 (0)