-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from twe4ked/master
Add `entries_for_feed` method
- Loading branch information
Showing
11 changed files
with
65 additions
and
50 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
|
||
group :test do | ||
gem "webmock" | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
|
||
task :default => [:spec] | ||
desc 'run Rspec specs' | ||
task :spec do | ||
sh 'rspec' | ||
end | ||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Feedbin | ||
VERSION = "0.0.5" | ||
VERSION = '0.0.5' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,48 +6,55 @@ | |
@feedbin = FeedbinAPI.new('email', 'password') | ||
end | ||
|
||
describe '.entries' do | ||
describe '#entries' do | ||
it 'should get entries and return a 200' do | ||
stub_request(:get, "https://email:[email protected]/v2/entries.json?").to_return(status: 200) | ||
@feedbin.entries.code.should == 200 | ||
expect(@feedbin.entries.code).to eq(200) | ||
end | ||
|
||
it 'should return a 200 when parameter is passed' do | ||
stub_request(:get, "https://email:[email protected]/v2/entries.json?read=false").to_return(status: 200) | ||
@feedbin.entries(read: false).code.should == 200 | ||
expect(@feedbin.entries(read: false).code).to eq(200) | ||
end | ||
end | ||
|
||
describe '.subscriptions' do | ||
describe '#entries_for_feed' do | ||
it 'should get entries for a feed and return a 200' do | ||
stub_request(:get, "https://email:[email protected]/v2/feeds/42/entries.json").to_return(status: 200) | ||
expect(@feedbin.entries_for_feed(42).code).to eq(200) | ||
end | ||
end | ||
|
||
describe '#subscriptions' do | ||
it 'should get subscriptions and return a 200' do | ||
stub_request(:get, "https://email:[email protected]/v2/subscriptions.json").to_return(status: 200) | ||
@feedbin.subscriptions.code.should == 200 | ||
expect(@feedbin.subscriptions.code).to eq(200) | ||
end | ||
end | ||
|
||
describe '.unsubscribe' do | ||
describe '#unsubscribe' do | ||
it 'should unsubscribe and return a 204' do | ||
stub_request(:delete, "https://email:[email protected]/v2/subscriptions/260815.json").to_return(status: 204) | ||
@feedbin.unsubscribe(260815).should == 204 | ||
expect(@feedbin.unsubscribe(260815)).to eq(204) | ||
end | ||
end | ||
|
||
describe '.feed' do | ||
describe '#feed' do | ||
it 'should get feed and return a 200' do | ||
stub_request(:get, "https://email:[email protected]/v2/feeds/1.json").to_return(status: 200) | ||
@feedbin.feed(1).code.should == 200 | ||
expect(@feedbin.feed(1).code).to eq(200) | ||
end | ||
end | ||
|
||
describe '.star' do | ||
describe '#star' do | ||
it 'should star a post and return a 200' do | ||
stub_request(:post, "https://email:[email protected]/v2/starred_entries.json").to_return(status: 200) | ||
@feedbin.star(33).should == 200 | ||
expect(@feedbin.star(33)).to eq(200) | ||
end | ||
|
||
it 'should star an array of posts and return a 200' do | ||
stub_request(:post, "https://email:[email protected]/v2/starred_entries.json").to_return(status: 200) | ||
@feedbin.star([33,44,55,66,77]).should == 200 | ||
expect(@feedbin.star([33,44,55,66,77])).to eq(200) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
|
||
RSpec.configure do |c| | ||
c.include(WebMock::API) | ||
end | ||
end |