Permalink
Browse files

Alias Twitter::Tweet#reply? to Twitter::Tweet#in_reply_to_user_id?

Before this patch, manual replies (created without pressing a reply
button) would return false, since they do not have an
in_reply_to_status_id.
  • Loading branch information...
1 parent 7bfc7e5 commit 57147287d25e21a5e740ee69c3e9aeec6abd1b06 @sferik committed Feb 15, 2014
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/twitter/tweet.rb
  2. +3 −3 spec/twitter/tweet_spec.rb
View
@@ -13,7 +13,7 @@ class Tweet < Twitter::Identity
deprecate_alias :favorites_count, :favorite_count
deprecate_alias :favoriters_count, :favorite_count
alias_method :in_reply_to_tweet_id, :in_reply_to_status_id
- alias_method :reply?, :in_reply_to_status_id?
+ alias_method :reply?, :in_reply_to_user_id?
deprecate_alias :retweeters_count, :retweet_count
object_attr_reader :GeoFactory, :geo
object_attr_reader :Metadata, :metadata
@@ -270,11 +270,11 @@
end
describe '#reply?' do
- it 'returns true when there is an in-reply-to status' do
- tweet = Twitter::Tweet.new(:id => 28_669_546_014, :in_reply_to_status_id => 114_749_583_439_036_416)
+ it 'returns true when there is an in-reply-to user' do
+ tweet = Twitter::Tweet.new(:id => 28_669_546_014, :in_reply_to_user_id => 7_505_382)
expect(tweet.reply?).to be true
end
- it 'returns false when in_reply_to_status_id is not set' do
+ it 'returns false when in_reply_to_user_id is not set' do
tweet = Twitter::Tweet.new(:id => 28_669_546_014)
expect(tweet.reply?).to be false
end

0 comments on commit 5714728

Please sign in to comment.