1
0

follow_request_spec.rb 756 B

12345678910111213141516171819202122232425
  1. require 'rails_helper'
  2. RSpec.describe FollowRequest, type: :model do
  3. describe '#authorize!'
  4. describe '#reject!'
  5. describe 'validations' do
  6. it 'has a valid fabricator' do
  7. follow_request = Fabricate.build(:follow_request)
  8. expect(follow_request).to be_valid
  9. end
  10. it 'is invalid without an account' do
  11. follow_request = Fabricate.build(:follow_request, account: nil)
  12. follow_request.valid?
  13. expect(follow_request).to model_have_error_on_field(:account)
  14. end
  15. it 'is invalid without a target account' do
  16. follow_request = Fabricate.build(:follow_request, target_account: nil)
  17. follow_request.valid?
  18. expect(follow_request).to model_have_error_on_field(:target_account)
  19. end
  20. end
  21. end