|
|
@ -2,10 +2,10 @@ require 'rails_helper'
|
|
|
|
|
|
|
|
|
|
|
|
describe AccountFilter do
|
|
|
|
describe AccountFilter do
|
|
|
|
describe 'with empty params' do
|
|
|
|
describe 'with empty params' do
|
|
|
|
it 'defaults to alphabetic account list' do
|
|
|
|
it 'defaults to recent account list' do
|
|
|
|
filter = described_class.new({})
|
|
|
|
filter = described_class.new({})
|
|
|
|
|
|
|
|
|
|
|
|
expect(filter.results).to eq Account.alphabetic
|
|
|
|
expect(filter.results).to eq Account.recent
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -60,7 +60,7 @@ describe AccountFilter do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
describe 'that call account methods' do
|
|
|
|
describe 'that call account methods' do
|
|
|
|
%i(local remote silenced recent suspended).each do |option|
|
|
|
|
%i(local remote silenced alphabetic suspended).each do |option|
|
|
|
|
it "delegates the #{option} option" do
|
|
|
|
it "delegates the #{option} option" do
|
|
|
|
allow(Account).to receive(option).and_return(Account.none)
|
|
|
|
allow(Account).to receive(option).and_return(Account.none)
|
|
|
|
filter = described_class.new({ option => true })
|
|
|
|
filter = described_class.new({ option => true })
|
|
|
|