Do not delete users when deleting legislation answers
When a legislation process is deleted, everything related will be deleted, including the answers. This `dependent: :destroy` was causing that users accounts were being accidentally deleted.
This commit is contained in:
committed by
Javi Martín
parent
c03ada579d
commit
46c78fc3ef
@@ -36,4 +36,12 @@ RSpec.describe Legislation::Answer, type: :model do
|
||||
expect(option_2.answers_count).to eq 1
|
||||
expect(option_1.answers_count).to eq 0
|
||||
end
|
||||
|
||||
it "does not delete users that created the answer" do
|
||||
user = legislation_answer.user
|
||||
|
||||
legislation_answer.destroy!
|
||||
|
||||
expect(user).not_to be_hidden
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user