1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-01 00:08:39 +09:00
YuruToot/spec/models/follow_spec.rb
Eugen Rochko a08e724476 Fix subscriptions:clear task, refactor feeds, refactor streamable activites
and atom feed generation to some extent, as well as the way mentions are
stored
2016-03-25 02:13:30 +01:00

39 lines
841 B
Ruby

require 'rails_helper'
RSpec.describe Follow, type: :model do
let(:alice) { Fabricate(:account, username: 'alice') }
let(:bob) { Fabricate(:account, username: 'bob') }
subject { Follow.new(account: alice, target_account: bob) }
describe '#verb' do
it 'is follow' do
expect(subject.verb).to be :follow
end
end
describe '#title' do
it 'describes the follow' do
expect(subject.title).to eql 'alice started following bob'
end
end
describe '#content' do
it 'is the same as the title' do
expect(subject.content).to eql subject.title
end
end
describe '#object_type' do
it 'is a person' do
expect(subject.object_type).to be :person
end
end
describe '#target' do
it 'is the person being followed' do
expect(subject.target).to eq bob
end
end
end