DEV: Order links by domain and url in spec

This commit is contained in:
Penar Musaraj 2020-08-12 17:46:12 -04:00
parent 9bc992dce4
commit ced8cdad24
No known key found for this signature in database
GPG Key ID: E390435D881FF0F7
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ describe UserSummarySerializer do
topic = Fabricate(:topic) topic = Fabricate(:topic)
post = Fabricate(:post_with_external_links, user: topic.user, topic: topic) post = Fabricate(:post_with_external_links, user: topic.user, topic: topic)
TopicLink.extract_from(post) TopicLink.extract_from(post)
TopicLink.where(topic_id: topic.id).order(domain: :asc).each_with_index do |link, index| TopicLink.where(topic_id: topic.id).order(domain: :asc, url: :asc).each_with_index do |link, index|
index.times do |i| index.times do |i|
TopicLinkClick.create(topic_link: link, ip_address: "192.168.1.#{i + 1}") TopicLinkClick.create(topic_link: link, ip_address: "192.168.1.#{i + 1}")
end end