BURs: add processing and failed states.
When a BUR is approved, put it in a `processing` state. After it successfully finishes processing, put it in the `approved` state. If it fails processing, put it in the `failed` state. If approving the BUR fails with a validation error, for example because the alias already exists or an implication lacks a wiki, then leave the BUR in the `pending` state. The `failed` state is only for unexpected errors during processing.
This commit is contained in:
@@ -76,13 +76,22 @@ class DTextTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
should "parse [ta:<id>], [ti:<id>], [bur:<id>] pseudo tags" do
|
||||
@bur = create(:bulk_update_request)
|
||||
@bur = create(:bulk_update_request, approver: create(:admin_user))
|
||||
@ti = create(:tag_implication)
|
||||
@ta = create(:tag_alias)
|
||||
|
||||
assert_match(/bulk update request/, DText.format_text("[bur:#{@bur.id}]"))
|
||||
assert_match(/implication ##{@ti.id}/, DText.format_text("[ti:#{@ti.id}]"))
|
||||
assert_match(/alias ##{@ta.id}/, DText.format_text("[ta:#{@ta.id}]"))
|
||||
BulkUpdateRequest::STATUSES.each do |status|
|
||||
@bur.update!(status: status)
|
||||
assert_match(/bulk update request/, DText.format_text("[bur:#{@bur.id}]"))
|
||||
end
|
||||
|
||||
TagRelationship::STATUSES.each do |status|
|
||||
@ta.update!(status: status)
|
||||
@ti.update!(status: status)
|
||||
|
||||
assert_match(/implication ##{@ti.id}/, DText.format_text("[ti:#{@ti.id}]"))
|
||||
assert_match(/alias ##{@ta.id}/, DText.format_text("[ta:#{@ta.id}]"))
|
||||
end
|
||||
end
|
||||
|
||||
should "link artist tags to the artist page instead of the wiki page" do
|
||||
|
||||
Reference in New Issue
Block a user