aliases: fix bug when trying to move wiki pages.

This commit is contained in:
evazion
2019-12-26 15:13:14 -06:00
parent 231e4872ed
commit b6a3a05422
2 changed files with 11 additions and 1 deletions

View File

@@ -160,6 +160,16 @@ class TagAliasTest < ActiveSupport::TestCase
end
end
should "move existing wikis" do
wiki = create(:wiki_page, title: "aaa")
ta = create(:tag_alias, antecedent_name: "aaa", consequent_name: "bbb", status: "pending")
ta.approve!(approver: @admin)
perform_enqueued_jobs
assert_equal("bbb", wiki.reload.title)
end
should "move existing aliases" do
ta1 = FactoryBot.create(:tag_alias, :antecedent_name => "aaa", :consequent_name => "bbb", :status => "pending")
ta2 = FactoryBot.create(:tag_alias, :antecedent_name => "bbb", :consequent_name => "ccc", :status => "pending")