* Add dependent: :destroy relation to user.notes * Add cleanup script for orphaned notes * Reorder relations and reorganize specs in User * Update specs as notes are not needed after a user is deleted * Tweets can just be nullified * Add other cleanup scripts * Tell the specs we keep tweets * Fix comments * Keep page_views and rating_votes when a user is deleted * Fix specs
9 lines
291 B
Ruby
9 lines
291 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe Note, type: :model do
|
|
it { is_expected.to belong_to(:noteable) }
|
|
it { is_expected.to belong_to(:author).class_name("User").optional }
|
|
|
|
it { is_expected.to validate_presence_of(:content) }
|
|
it { is_expected.to validate_presence_of(:reason) }
|
|
end
|