Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 57147287d25e21a5e740ee69c3e9aeec6abd1b06 1 parent 7bfc7e5
@sferik authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  lib/twitter/tweet.rb
  2. +3 −3 spec/twitter/tweet_spec.rb
View
2  lib/twitter/tweet.rb
@@ -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
View
6 spec/twitter/tweet_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.