BURs: fix broken [bur:<id>] links in forum posts.
Fix bulk update requests generating invalid [bur:<id>] links in forum
posts. The id was missing because the BUR created the forum topic in a
before_create hook, which created the post before the BUR was saved so
the BUR didn't have an id yet. Fix regression caused by b4ce2d83.
This commit is contained in:
@@ -104,9 +104,11 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
should "create a forum topic" do
|
||||
assert_difference("ForumTopic.count", 1) do
|
||||
BulkUpdateRequest.create(:title => "abc", :reason => "zzz", :script => "create alias aaa -> bbb", :skip_secondary_validations => true)
|
||||
end
|
||||
bur = create(:bulk_update_request, reason: "zzz", script: "create alias aaa -> bbb")
|
||||
|
||||
assert_equal(true, bur.forum_post.present?)
|
||||
assert_match(/\[bur:#{bur.id}\]/, bur.forum_post.body)
|
||||
assert_match(/zzz/, bur.forum_post.body)
|
||||
end
|
||||
|
||||
context "that has an invalid alias" do
|
||||
|
||||
Reference in New Issue
Block a user