2016-09-09 21:04:34 +03:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe FeedManager do
|
|
|
|
describe '#key' do
|
|
|
|
subject { FeedManager.instance.key(:home, 1) }
|
|
|
|
|
|
|
|
it 'returns a string' do
|
|
|
|
expect(subject).to be_a String
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-10-02 16:28:47 +03:00
|
|
|
describe '#filter?' do
|
2016-09-09 21:04:34 +03:00
|
|
|
let(:followee) { Fabricate(:account, username: 'alice') }
|
|
|
|
let(:status) { Fabricate(:status, text: 'Hello world', account: followee) }
|
|
|
|
let(:follower) { Fabricate(:account, username: 'bob') }
|
|
|
|
|
2016-10-02 16:28:47 +03:00
|
|
|
subject { FeedManager.instance.filter?(:home, status, follower) }
|
2016-09-09 21:04:34 +03:00
|
|
|
|
|
|
|
it 'returns a boolean value' do
|
|
|
|
expect(subject).to be false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|