Sha256: f0e35a83463353d99b5aceee5de77a530b599fb99c1d6610d395ace2be9cfc07
Contents?: true
Size: 1.15 KB
Versions: 1
Compression:
Stored size: 1.15 KB
Contents
# frozen_string_literal: true require "test_helper" module SocialUrl class MessageTest < Minitest::Test def setup @message = Message.new({}) @complete_message = Message.new( text: "Hello World", url: "http://example.com", hashtags: %w(nature sunset), via: "twitterdev", related: ["twitter:Twitter News", "twitterapi:Twitter API News"] ) end def teardown @message.destroy @complete_message.destroy end def test_exposes_network_methods SocialUrl.networks.each do |network| method = "#{network}_url".to_sym assert_respond_to @message, method end end def test_throws_on_invalid_network assert_raises UnsupportedNetworkError do @message.derp_url end end def test_network_url url = ["https://twitter.com/intent/tweet/?text=Hello%20World", "&url=http%3A%2F%2Fexample.com", "&hashtags=nature,sunset", "&via=twitterdev", "&related=twitter%3ATwitter%20News,twitterapi%3ATwitter%20API%20News"].join assert_equal url, @complete_message.twitter_url end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
social-url-1.1.1 | test/lib/social_url/message_test.rb |