Skip to content

Commit 14e5ffd

Browse files
committed
all posts route and spec
1 parent d97f0f4 commit 14e5ffd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/cortex/posts.rb

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ def feed(params = {})
88
client.get('/posts/feed', params)
99
end
1010

11+
def all_posts(params = {})
12+
client.get('/posts/feed/all_posts', params)
13+
end
14+
1115
def get(id)
1216
client.get("/posts/#{id}")
1317
end

spec/posts_spec.rb

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242
end
4343
end
4444

45+
describe :all_posts do
46+
it 'should correctly make the request' do
47+
client.expects(:get).with('/posts/feed/all_posts', {}).returns('response')
48+
expect(client.posts.all_posts()).to eq('response')
49+
end
50+
end
51+
4552
describe :save do
4653
context 'with an existing post' do
4754
it 'should correctly make the request' do

0 commit comments

Comments
 (0)