Skip to content

Commit

Permalink
update integration tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vasconsaurus committed Jun 5, 2024
1 parent 841963d commit 5acddc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/integration/parsers/twitter_item_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
4 changes: 2 additions & 2 deletions test/integration/parsers/twitter_profile_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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']
Expand Down

0 comments on commit 5acddc8

Please sign in to comment.