Skip to content

Commit

Permalink
failing spec for "strange urls"
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewrudy committed Nov 28, 2013
1 parent 8fd5028 commit 61545f4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/twitter/tweet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,23 @@
Twitter::Tweet.new(:id => 28669546014).urls
expect($stderr.string).to match(/To get urls, you must pass `:include_entities => true` when requesting the Twitter::Tweet\./)
end

it "can handle strange urls" do
urls_array = [
{
:url => "http://with_underscore.example.com/t.co",
:expanded_url => "http://with_underscore.example.com/expanded",
:display_url => "with_underscore.example.com/expanded…",
:indices => [10, 33],
}
]
tweet = Twitter::Tweet.new(:id => 28669546014, :entities => {:urls => urls_array})
uri = tweet.uris.first
expect{ uri.url }.to_not raise_error
expect{ uri.expanded_url }.to_not raise_error
expect{ uri.display_url }.to_not raise_error
end

end

describe "#uri" do
Expand Down

0 comments on commit 61545f4

Please sign in to comment.