Permalink
Browse files

Correct retweet response. Retweeted status should be the original tweet

  • Loading branch information...
1 parent ee40768 commit 70fede7fa09a87b7e1cba5b8b4be82127c9eaf51 @Ian-Choi Ian-Choi committed Mar 3, 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
@@ -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
@@ -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?
@@ -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 70fede7

Please sign in to comment.