logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

mention_spec.rb (595B)


  1. require 'rails_helper'
  2. RSpec.describe Mention, type: :model do
  3. describe 'validations' do
  4. it 'has a valid fabricator' do
  5. mention = Fabricate.build(:mention)
  6. expect(mention).to be_valid
  7. end
  8. it 'is invalid without an account' do
  9. mention = Fabricate.build(:mention, account: nil)
  10. mention.valid?
  11. expect(mention).to model_have_error_on_field(:account)
  12. end
  13. it 'is invalid without a status' do
  14. mention = Fabricate.build(:mention, status: nil)
  15. mention.valid?
  16. expect(mention).to model_have_error_on_field(:status)
  17. end
  18. end
  19. end