diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-02-16 10:05:10 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-02-24 14:20:20 +0300 |
commit | f2ed82fa8486875660b80dd061827ac8b86d00b6 (patch) | |
tree | 07b0221a225f32de7a3063a4bee2ff97463f9c54 /spec/services/users | |
parent | 3bd2a98f64a12a2e23a6b9ce77427a9c2033a6bf (diff) |
Implement final review comments from @DouweM and @rymai
- Have `Uniquify` take a block instead of a Proc/function. This is more
idiomatic than passing around a function in Ruby.
- Block a user before moving their issues to the ghost user. This avoids a data
race where an issue is created after the issues are migrated to the ghost user,
and before the destroy takes place.
- No need to migrate issues (to the ghost user) in a transaction, because
we're using `update_all`
- Other minor changes
Diffstat (limited to 'spec/services/users')
-rw-r--r-- | spec/services/users/destroy_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/services/users/destroy_spec.rb b/spec/services/users/destroy_spec.rb index 4f0834064e5..922e82445d0 100644 --- a/spec/services/users/destroy_spec.rb +++ b/spec/services/users/destroy_spec.rb @@ -47,6 +47,10 @@ describe Users::DestroyService, services: true do expect(migrated_issue.author).to eq(User.ghost) end + + it 'blocks the user before migrating issues to the "Ghost User' do + expect(user).to be_blocked + end end context "for an issue the user was assigned to" do |