闭社主体 forked from https://github.com/tootsuite/mastodon
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.

25 lines
756 B

  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