follow_spec.rb 841 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. require 'rails_helper'
  2. RSpec.describe Follow, type: :model do
  3. let(:alice) { Fabricate(:account, username: 'alice') }
  4. let(:bob) { Fabricate(:account, username: 'bob') }
  5. subject { Follow.new(account: alice, target_account: bob) }
  6. describe '#verb' do
  7. it 'is follow' do
  8. expect(subject.verb).to be :follow
  9. end
  10. end
  11. describe '#title' do
  12. it 'describes the follow' do
  13. expect(subject.title).to eql 'alice started following bob'
  14. end
  15. end
  16. describe '#content' do
  17. it 'is the same as the title' do
  18. expect(subject.content).to eql subject.title
  19. end
  20. end
  21. describe '#object_type' do
  22. it 'is a person' do
  23. expect(subject.object_type).to be :person
  24. end
  25. end
  26. describe '#target' do
  27. it 'is the person being followed' do
  28. expect(subject.target).to eq bob
  29. end
  30. end
  31. end