diff --git a/lib/twitter/client/tweets.rb b/lib/twitter/client/tweets.rb index 764e793ec..05865b1ce 100644 --- a/lib/twitter/client/tweets.rb +++ b/lib/twitter/client/tweets.rb @@ -130,8 +130,10 @@ def status_destroy(id, options={}) # @example Retweet the status with the ID 28561922516 # Twitter.retweet(28561922516) def retweet(id, options={}) - status = post("/1/statuses/retweet/#{id}.json", options)['retweeted_status'] - Twitter::Status.new(status) + new_status = post("/1/statuses/retweet/#{id}.json", options) + orig_status = new_status.delete('retweeted_status') + orig_status['retweeted_status'] = new_status + Twitter::Status.new(orig_status) end # Updates the authenticating user's status diff --git a/spec/twitter/client/tweets_spec.rb b/spec/twitter/client/tweets_spec.rb index 54269beb2..b40a960bf 100644 --- a/spec/twitter/client/tweets_spec.rb +++ b/spec/twitter/client/tweets_spec.rb @@ -108,6 +108,8 @@ status = @client.retweet(28561922516) status.should be_a Twitter::Status status.text.should == "As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush." + status.retweeted_status.text.should == "RT @gruber: As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush." + status.retweeted_status.id.should_not == status.id end end