-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 3rd party api endpoint support for Tumblr, etc
- Loading branch information
Wynn Netherland
committed
Dec 18, 2009
1 parent
2571cd8
commit c5550f1
Showing
3 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -28,7 +28,7 @@ class BaseTest < Test::Unit::TestCase | |
|
||
context "hitting the api" do | ||
should "be able to get home timeline" do | ||
stub_get('http://api.twitter.com/1/statuses/home_timeline.json', 'home_timeline.json') | ||
stub_get('/statuses/home_timeline.json', 'home_timeline.json') | ||
timeline = @twitter.home_timeline | ||
timeline.size.should == 20 | ||
first = timeline.first | ||
|
@@ -219,7 +219,7 @@ class BaseTest < Test::Unit::TestCase | |
end | ||
|
||
should "be able to view lists for the authenticated user" do | ||
stub_get('http://api.twitter.com/1/pengwynn/lists.json', 'lists.json') | ||
stub_get('/pengwynn/lists.json', 'lists.json') | ||
lists = @twitter.lists('pengwynn').lists | ||
lists.size.should == 1 | ||
lists.first.name.should == 'Rubyists' | ||
|
@@ -316,7 +316,17 @@ class BaseTest < Test::Unit::TestCase | |
end | ||
|
||
end | ||
end | ||
|
||
context "when using a non-twitter service" do | ||
setup do | ||
@twitter = Twitter::Base.new(Twitter::HTTPAuth.new('[email protected]', 'mypass', :api_endpoint => 'tumblr.com')) | ||
end | ||
|
||
|
||
should "get the home timeline" do | ||
stub_get('http://wynn%40example.com:[email protected]/statuses/home_timeline.json', 'home_timeline.json') | ||
timeline = @twitter.home_timeline | ||
timeline.size.should == 20 | ||
end | ||
end | ||
end |