You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
595 B

  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