FIX: Incorrect scope when checking for existing topic link.

This commit is contained in:
Guo Xiang Tan
2016-06-15 13:45:07 +08:00
parent e1cfe7536c
commit bf64280661
2 changed files with 11 additions and 1 deletions

View File

@@ -121,6 +121,16 @@ http://b.com/#{'a'*500}
expect(reflection.user_id).to eq(link.user_id)
end
PostOwnerChanger.new(
post_ids: [linked_post.id],
topic_id: topic.id,
acting_user: user,
new_owner: Fabricate(:user)
).change_owner!
TopicLink.extract_from(linked_post)
expect(topic.topic_links.first.url).to eq(url)
linked_post.revise(post.user, { raw: "no more linkies https://eviltrout.com" })
expect(other_topic.topic_links.where(link_post_id: linked_post.id)).to be_blank
end