Skip to content

Commit 7afd94e

Browse files
committed
Add test for since option on Page#posts Page#videos
1 parent 20a356a commit 7afd94e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

spec/pages/posts_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,18 @@
2727
end
2828
end
2929
end
30+
31+
describe '#posts with since option' do
32+
let(:page) { Funky::Page.find(page_id) }
33+
let(:posts) { page.posts(since: since_date) }
34+
35+
context 'given an existing page ID and since date' do
36+
let(:page_id) { fullscreen_page_id }
37+
let(:since_date) { "2017-07-27" }
38+
39+
specify 'returns the first post of since date as the last' do
40+
expect(posts.last.id).to eq('221406534569729_1516478451729191')
41+
end
42+
end
43+
end
3044
end

spec/pages/videos_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,18 @@
8080
end
8181
end
8282
end
83+
84+
describe '#videos with since option' do
85+
let(:page) { Funky::Page.find(page_id) }
86+
let(:videos) { page.videos(since: since_date) }
87+
88+
context 'given an existing page ID and since date' do
89+
let(:page_id) { fullscreen_page_id }
90+
let(:since_date) { "2017-07-27" }
91+
92+
specify 'returns the first video of since date as the last' do
93+
expect(videos.last.id).to eq('1517225178321185')
94+
end
95+
end
96+
end
8397
end

0 commit comments

Comments
 (0)