diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-01 03:55:03 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-17 18:58:58 +0300 |
commit | baec3d236b239c720f2fc550bdfa22c09380f0aa (patch) | |
tree | 5d50542809525db380fbe378d6b3aeb526c41897 /spec | |
parent | 4b75c75018c9a3eac7a2c8b1772a10c98ea3bdc0 (diff) |
Remove label_list factory
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/lists.rb | 7 | ||||
-rw-r--r-- | spec/models/list_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/boards/issues/move_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/boards/lists/create_service_spec.rb | 6 | ||||
-rw-r--r-- | spec/services/boards/lists/destroy_service_spec.rb | 8 | ||||
-rw-r--r-- | spec/services/boards/lists/move_service_spec.rb | 10 |
6 files changed, 17 insertions, 20 deletions
diff --git a/spec/factories/lists.rb b/spec/factories/lists.rb index 7b41361500c..9e3f06c682c 100644 --- a/spec/factories/lists.rb +++ b/spec/factories/lists.rb @@ -2,6 +2,8 @@ FactoryGirl.define do factory :list do board label + list_type :label + sequence(:position) end factory :backlog_list, parent: :list do @@ -10,11 +12,6 @@ FactoryGirl.define do position nil end - factory :label_list, parent: :list do - list_type :label - sequence(:position) - end - factory :done_list, parent: :list do list_type :done label nil diff --git a/spec/models/list_spec.rb b/spec/models/list_spec.rb index 45c07a679cb..2dca15cef9c 100644 --- a/spec/models/list_spec.rb +++ b/spec/models/list_spec.rb @@ -34,7 +34,7 @@ describe List do describe '#destroy' do it 'can be destroyed when when list_type is set to label' do - subject = create(:label_list) + subject = create(:list) expect(subject.destroy).to be_truthy end diff --git a/spec/services/boards/issues/move_service_spec.rb b/spec/services/boards/issues/move_service_spec.rb index a0f72dddc09..285dd61a0e6 100644 --- a/spec/services/boards/issues/move_service_spec.rb +++ b/spec/services/boards/issues/move_service_spec.rb @@ -11,8 +11,8 @@ describe Boards::Issues::MoveService, services: true do let(:testing) { create(:label, project: project, name: 'Testing') } let(:backlog) { create(:backlog_list, board: board) } - let(:list1) { create(:label_list, board: board, label: development) } - let(:list2) { create(:label_list, board: board, label: testing) } + let(:list1) { create(:list, board: board, label: development) } + let(:list2) { create(:list, board: board, label: testing) } let(:done) { create(:done_list, board: board) } before do diff --git a/spec/services/boards/lists/create_service_spec.rb b/spec/services/boards/lists/create_service_spec.rb index 0e8190794a0..25c6d614229 100644 --- a/spec/services/boards/lists/create_service_spec.rb +++ b/spec/services/boards/lists/create_service_spec.rb @@ -28,8 +28,8 @@ describe Boards::Lists::CreateService, services: true do context 'when board lists has only labels lists' do it 'creates a new list at end of the lists' do - create(:label_list, board: board, position: 1) - create(:label_list, board: board, position: 2) + create(:list, board: board, position: 1) + create(:list, board: board, position: 2) list = described_class.new(project, label_id: label.id).execute @@ -41,7 +41,7 @@ describe Boards::Lists::CreateService, services: true do it 'creates a new list at end of the label lists' do create(:backlog_list, board: board) create(:done_list, board: board) - list1 = create(:label_list, board: board, position: 1) + list1 = create(:list, board: board, position: 1) list2 = described_class.new(project, label_id: label.id).execute diff --git a/spec/services/boards/lists/destroy_service_spec.rb b/spec/services/boards/lists/destroy_service_spec.rb index 4d50bd2d123..7c19dd36e30 100644 --- a/spec/services/boards/lists/destroy_service_spec.rb +++ b/spec/services/boards/lists/destroy_service_spec.rb @@ -7,7 +7,7 @@ describe Boards::Lists::DestroyService, services: true do context 'when list type is label' do it 'removes list from board' do - list = create(:label_list, board: board) + list = create(:list, board: board) service = described_class.new(project, list_id: list.id) expect { service.execute }.to change(board.lists, :count).by(-1) @@ -15,9 +15,9 @@ describe Boards::Lists::DestroyService, services: true do it 'decrements position of higher lists' do backlog = create(:backlog_list, board: board) - development = create(:label_list, board: board, position: 1) - review = create(:label_list, board: board, position: 2) - staging = create(:label_list, board: board, position: 3) + development = create(:list, board: board, position: 1) + review = create(:list, board: board, position: 2) + staging = create(:list, board: board, position: 3) done = create(:done_list, board: board) described_class.new(project, list_id: development.id).execute diff --git a/spec/services/boards/lists/move_service_spec.rb b/spec/services/boards/lists/move_service_spec.rb index 97de502e069..35b1d9a4b75 100644 --- a/spec/services/boards/lists/move_service_spec.rb +++ b/spec/services/boards/lists/move_service_spec.rb @@ -6,11 +6,11 @@ describe Boards::Lists::MoveService, services: true do let(:board) { project.board } let!(:backlog) { create(:backlog_list, board: board) } - let!(:planning) { create(:label_list, board: board, position: 1) } - let!(:development) { create(:label_list, board: board, position: 2) } - let!(:review) { create(:label_list, board: board, position: 3) } - let!(:staging) { create(:label_list, board: board, position: 4) } - let!(:done) { create(:done_list, board: board) } + let!(:planning) { create(:list, board: board, position: 1) } + let!(:development) { create(:list, board: board, position: 2) } + let!(:review) { create(:list, board: board, position: 3) } + let!(:staging) { create(:list, board: board, position: 4) } + let!(:done) { create(:done_list, board: board) } context 'when list type is set to label' do it 'keeps position of lists when new position is nil' do |