Fix Retweet Return Information #228

Merged
merged 2 commits into from Jan 19, 2012
@@ -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
@@ -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