Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
6 lines (5 sloc) 616 Bytes
# #foo @bar http://t.co/PI9t2u5
tweet1 = `{"entities":{"user_mentions":[{"name":"mr bar","indices":[5,9],"id_str":"2530071","id":2530071,"screen_name":"bar"}],"hashtags":[{"text":"foo","indices":[0,4]}],"urls":[{"url":"http://t.co/PI9t2u5","display_url":"google.com","indices":[10,29],"expanded_url":"http://google.com/"}]},"text":"#foo @bar http://t.co/PI9t2u5"}`
describe "linkifyTweet", ->
it "should linkify URL", ->
expect(linkifyTweet(tweet1)).toEqual "<a href='http://twitter.com/search?q=%23foo'>#foo</a> <a href='http://twitter.com/bar'>@bar</a> <a href='http://t.co/PI9t2u5'>http://t.co/PI9t2u5</a>"