artists: fix ban/unban actions.
Fix the ban! and unban! methods to: * Lock the artist while it is being banned or unbanned. * Perform the edits as a mass update, so that the posts are updated in parallel. * Edit the artist as the banner rather than as the current user. * Soft delete the banned_artist implication when an artist is unbanned instead of hard deleting it. * Ignore the banned_artist implication if it's deleted.
This commit is contained in:
@@ -384,11 +384,7 @@ class PostTest < ActiveSupport::TestCase
|
||||
|
||||
context "with a banned artist" do
|
||||
setup do
|
||||
CurrentUser.scoped(FactoryBot.create(:admin_user)) do
|
||||
@artist = FactoryBot.create(:artist)
|
||||
@artist.ban!
|
||||
perform_enqueued_jobs
|
||||
end
|
||||
@artist = create(:artist, is_banned: true)
|
||||
@post = FactoryBot.create(:post, :tag_string => @artist.name)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user