From 5acddc8aef6b86aadb3b916de14bc9ef52c0a8f9 Mon Sep 17 00:00:00 2001 From: manu vasconcelos Date: Wed, 5 Jun 2024 16:01:33 -0300 Subject: [PATCH] update integration tests Now it returns as x.com and not twitter.com I simplified it (in case for some reason it still returns as twitter), I think if the rest of the link is correct we are fine. --- test/integration/parsers/twitter_item_test.rb | 2 +- test/integration/parsers/twitter_profile_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/parsers/twitter_item_test.rb b/test/integration/parsers/twitter_item_test.rb index 96a016e6..6176d916 100644 --- a/test/integration/parsers/twitter_item_test.rb +++ b/test/integration/parsers/twitter_item_test.rb @@ -14,7 +14,7 @@ class TwitterItemIntegrationTest < ActiveSupport::TestCase test "should return data even if a the twitter item does not exist" do m = create_media url: 'https://twitter.com/caiosba/status/1111111111111111111' data = m.as_json - assert_match 'https://twitter.com/caiosba/status/1111111111111111111', data['title'] + assert_match /caiosba\/status\/1111111111111111111/, data['title'] assert_match 'caiosba', data['author_name'] assert_match '@caiosba', data['username'] assert_not_nil data['author_picture'] diff --git a/test/integration/parsers/twitter_profile_test.rb b/test/integration/parsers/twitter_profile_test.rb index ae173034..0e56541b 100644 --- a/test/integration/parsers/twitter_profile_test.rb +++ b/test/integration/parsers/twitter_profile_test.rb @@ -4,7 +4,7 @@ class TwitterProfileIntegrationTest < ActiveSupport::TestCase test "should parse shortened URL" do m = create_media url: 'http://bit.ly/23qFxCn' data = m.as_json - assert_equal 'https://twitter.com/caiosba', data['url'] + assert_match /caiosba/, data['url'] assert_not_nil data['title'] assert_match '@caiosba', data['username'] assert_equal 'twitter', data['provider'] @@ -16,7 +16,7 @@ class TwitterProfileIntegrationTest < ActiveSupport::TestCase test "should return data even if a the twitter profile does not exist" do m = create_media url: 'https://twitter.com/dlihfbfyhugsrb' data = m.as_json - assert_equal 'https://twitter.com/dlihfbfyhugsrb', data['url'] + assert_match /dlihfbfyhugsrb/, data['url'] assert_equal 'dlihfbfyhugsrb', data['title'] assert_match '@dlihfbfyhugsrb', data['username'] assert_equal 'twitter', data['provider']