diff options
Diffstat (limited to 'spec/models/list_spec.rb')
-rw-r--r-- | spec/models/list_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/list_spec.rb b/spec/models/list_spec.rb index f0b1bc33e84..922d6b01b82 100644 --- a/spec/models/list_spec.rb +++ b/spec/models/list_spec.rb @@ -17,6 +17,19 @@ RSpec.describe List do it { is_expected.to validate_presence_of(:list_type) } end + describe '.without_types' do + it 'exclude lists of given types' do + board = create(:list, list_type: :label).board + # closed list is created by default + backlog_list = create(:list, list_type: :backlog, board: board) + + exclude_type = [described_class.list_types[:label], described_class.list_types[:closed]] + + lists = described_class.without_types(exclude_type) + expect(lists.where(board: board)).to match_array([backlog_list]) + end + end + describe '#update_preferences_for' do let(:user) { create(:user) } let(:list) { create(:list) } |