Permalink
Browse files

Merge pull request #541 from jugnoo/master

Correct retweet response. Retweeted status should be the original tweet
  • Loading branch information...
2 parents 3c0a2db + 70fede7 commit ca6093aea518f45355a5acefe2ca53b31b85a6ef @sferik committed Mar 4, 2014
Showing with 5 additions and 8 deletions.
  1. +1 −3 lib/twitter/rest/tweets.rb
  2. +0 −1 lib/twitter/tweet.rb
  3. +4 −4 spec/twitter/rest/tweets_spec.rb
View
4 lib/twitter/rest/tweets.rb
@@ -300,9 +300,7 @@ def parallel_tweets_from_response(request_method, path, args)
def post_retweet(tweet, options)
response = post("/1.1/statuses/retweet/#{extract_id(tweet)}.json", options).body
- retweeted_status = response.delete(:retweeted_status)
- retweeted_status[:retweeted_status] = response
- Twitter::Tweet.new(retweeted_status)
+ Twitter::Tweet.new(response)
end
end
end
View
1 lib/twitter/tweet.rb
@@ -19,7 +19,6 @@ class Tweet < Twitter::Identity
object_attr_reader :Metadata, :metadata
object_attr_reader :Place, :place
object_attr_reader :Tweet, :retweeted_status
- alias_method :retweet, :retweeted_status
alias_method :retweeted_tweet, :retweeted_status
alias_method :retweet?, :retweeted_status?
alias_method :retweeted_tweet?, :retweeted_status?
View
8 spec/twitter/rest/tweets_spec.rb
@@ -347,8 +347,8 @@
tweets = @client.retweet(25_938_088_801)
expect(tweets).to be_an Array
expect(tweets.first).to be_a Twitter::Tweet
- expect(tweets.first.text).to eq("As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush.")
- expect(tweets.first.retweeted_tweet.text).to eq("RT @gruber: As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush.")
+ expect(tweets.first.text).to eq("RT @gruber: As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush.")
+ expect(tweets.first.retweeted_tweet.text).to eq("As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush.")
expect(tweets.first.retweeted_tweet.id).not_to eq(tweets.first.id)
end
context 'already retweeted' do
@@ -393,8 +393,8 @@
tweets = @client.retweet!(25_938_088_801)
expect(tweets).to be_an Array
expect(tweets.first).to be_a Twitter::Tweet
- expect(tweets.first.text).to eq("As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush.")
- expect(tweets.first.retweeted_tweet.text).to eq("RT @gruber: As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush.")
+ expect(tweets.first.text).to eq("RT @gruber: As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush.")
+ expect(tweets.first.retweeted_tweet.text).to eq("As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush.")
expect(tweets.first.retweeted_tweet.id).not_to eq(tweets.first.id)
end
context 'forbidden' do

0 comments on commit ca6093a

Please sign in to comment.