docbrown/spec/models/note_spec.rb
rhymes ba8b3dd443
[deploy] Add missing dependent clauses to User and cleanup relations (#10011)
* 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
2020-08-28 20:19:24 +02:00

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