Skip to content

Commit 85c3ce5

Browse files
author
Alex Tharp
authored
Merge pull request #28 from cortex-cms/all-posts
Retrieve All Posts
2 parents d97f0f4 + b2ab6ee commit 85c3ce5

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Version History
33
* All Version bumps are required to update this file as well!
44
----
55

6+
* 0.10.2 - Add all_posts function to posts class to retrieve all articles.
67
* 0.10.0:
78
* Utilize `Addressable::URI` as Faraday's default URI parser so that resourceful URI fragments are escaped and parsed properly
89
* Utilize `Faraday::Middleware` for `Hashie::Mash`ing & OAuth2 Token insertion

lib/cortex/posts.rb

Lines changed: 4 additions & 0 deletions
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

lib/cortex/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Cortex
2-
VERSION = '0.10.1'
2+
VERSION = '0.10.2'
33
end

spec/posts_spec.rb

Lines changed: 7 additions & 0 deletions
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)