* Add new table and model * Store banned user username hash on delete * Prevent previously banned user from signing up again * Update method name * Refactor code and add more specs * Test improvements * Don't override existing global flash * Fix typo * Update spec description * Update schema.rb * More schema.rb fixes * Simplify spec * Update migration * Clean up migration * Rename method * Add DataDog counter * Revisit error handling * Remove spurious empty line * Make model name more explicit
11 lines
309 B
Ruby
11 lines
309 B
Ruby
FactoryBot.define do
|
|
factory :suspended_username, class: "Users::SuspendedUsername" do
|
|
transient do
|
|
username { Faker::Internet.unique.username }
|
|
end
|
|
|
|
after(:build) do |user, evaluator|
|
|
user.username_hash = Users::SuspendedUsername.hash_username(evaluator.username)
|
|
end
|
|
end
|
|
end
|