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 Block, type: :model do
  3. describe 'validations' do
  4. it 'has a valid fabricator' do
  5. block = Fabricate.build(:block)
  6. expect(block).to be_valid
  7. end
  8. it 'is invalid without an account' do
  9. block = Fabricate.build(:block, account: nil)
  10. block.valid?
  11. expect(block).to model_have_error_on_field(:account)
  12. end
  13. it 'is invalid without a target_account' do
  14. block = Fabricate.build(:block, target_account: nil)
  15. block.valid?
  16. expect(block).to model_have_error_on_field(:target_account)
  17. end
  18. end
  19. end