test/twitterland/back_tweets_test.rb in twitterland-0.4.4 vs test/twitterland/back_tweets_test.rb in twitterland-0.4.5
- old
+ new
@@ -1,10 +1,10 @@
require File.dirname(__FILE__) + '/../test_helper'
class BackTweetsTest < Test::Unit::TestCase
include Twitterland
-
+
context "Hitting the BackTweets API" do
should "return tweets referencing a URL" do
stub_get 'http://backtweets.com/search.json?q=http%3A%2F%2Fsqueejee.com&key=OU812', 'backtweets.json'
results = Twitterland::BackTweets.search('http://squeejee.com', 'OU812')
results.items_per_page.should == 25
@@ -12,9 +12,16 @@
results.total_results.should == 35
last_tweet = results.tweets.last
last_tweet.id = 1642929098
last_tweet.from_user_id = 383935
last_tweet.from_user = 'Curvezilla'
-
+
end
+
+ should "raise Invalid key if bad key" do
+ stub_get 'http://backtweets.com/search.json?q=http%3A%2F%2Fsqueejee.com&key=OU812', 'backtweets_unauthenticated.json'
+ assert_raise Twitterland::BackTweets::Unauthenticated do
+ Twitterland::BackTweets.search('http://squeejee.com', 'OU812')
+ end
+ end
end
-end
\ No newline at end of file
+end