diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-14 12:09:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-14 12:09:23 +0300 |
commit | 7a7f602c2689ef1d204976b23a8e89bdf927e8e2 (patch) | |
tree | 5bd23ecff17955eddfb9c1426dc965c40213ecaf /spec/services | |
parent | aa6aa484ea38062f0038f67e0ff0e9fa5b4de8d3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/boards/issues/list_service_spec.rb | 10 | ||||
-rw-r--r-- | spec/services/boards/lists/list_service_spec.rb | 6 |
2 files changed, 5 insertions, 11 deletions
diff --git a/spec/services/boards/issues/list_service_spec.rb b/spec/services/boards/issues/list_service_spec.rb index 4089e9e6da0..c9d00f61a90 100644 --- a/spec/services/boards/issues/list_service_spec.rb +++ b/spec/services/boards/issues/list_service_spec.rb @@ -20,10 +20,10 @@ RSpec.describe Boards::Issues::ListService, feature_category: :team_planning do let_it_be(:p2) { create(:label, title: 'P2', project: project, priority: 2) } let_it_be(:p3) { create(:label, title: 'P3', project: project, priority: 3) } - let_it_be(:backlog) { create(:backlog_list, board: board) } + let_it_be(:backlog) { board.lists.backlog.first } let_it_be(:list1) { create(:list, board: board, label: development, position: 0) } let_it_be(:list2) { create(:list, board: board, label: testing, position: 1) } - let_it_be(:closed) { create(:closed_list, board: board) } + let_it_be(:closed) { board.lists.closed.first } let_it_be(:opened_issue1) { create(:labeled_issue, project: project, milestone: m1, title: 'Issue 1', labels: [bug]) } let_it_be(:opened_issue2) { create(:labeled_issue, project: project, milestone: m2, title: 'Issue 2', labels: [p2]) } @@ -109,10 +109,10 @@ RSpec.describe Boards::Issues::ListService, feature_category: :team_planning do let(:p2_project1) { create(:label, title: 'P2_project1', project: project1, priority: 2) } let(:p3_project1) { create(:label, title: 'P3_project1', project: project1, priority: 3) } - let!(:backlog) { create(:backlog_list, board: board) } + let!(:backlog) { board.lists.backlog.first } let!(:list1) { create(:list, board: board, label: development, position: 0) } let!(:list2) { create(:list, board: board, label: testing, position: 1) } - let!(:closed) { create(:closed_list, board: board) } + let!(:closed) { board.lists.closed.first } let!(:opened_issue1) { create(:labeled_issue, project: project, milestone: m1, title: 'Issue 1', labels: [bug]) } let!(:opened_issue2) { create(:labeled_issue, project: project, milestone: m2, title: 'Issue 2', labels: [p2, p2_project]) } @@ -145,7 +145,6 @@ RSpec.describe Boards::Issues::ListService, feature_category: :team_planning do context 'when the group is an ancestor' do let(:parent) { create(:group) } let(:group) { create(:group, parent: parent) } - let!(:backlog) { create(:backlog_list, board: board) } let(:board) { create(:board, group: parent) } before do @@ -161,7 +160,6 @@ RSpec.describe Boards::Issues::ListService, feature_category: :team_planning do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :empty_repo) } let_it_be(:board) { create(:board, project: project) } - let_it_be(:backlog) { create(:backlog_list, board: board) } let(:issue) { create(:issue, project: project, relative_position: nil) } diff --git a/spec/services/boards/lists/list_service_spec.rb b/spec/services/boards/lists/list_service_spec.rb index 90b705e05c3..97bd5e13454 100644 --- a/spec/services/boards/lists/list_service_spec.rb +++ b/spec/services/boards/lists/list_service_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Boards::Lists::ListService, feature_category: :team_planning do RSpec.shared_examples 'FOSS lists only' do context 'when board contains a non FOSS list' do # This scenario may happen when there used to be an EE license and user downgraded - let!(:backlog_list) { create_backlog_list(board) } + let_it_be(:backlog_list) { board.lists.backlog.first } let_it_be(:milestone) { create(:milestone, group: group) } let_it_be(:assignee_list) do list = build(:list, board: board, user_id: user.id, list_type: List.list_types[:assignee], position: 0) @@ -59,9 +59,5 @@ RSpec.describe Boards::Lists::ListService, feature_category: :team_planning do it_behaves_like 'lists list service' it_behaves_like 'FOSS lists only' end - - def create_backlog_list(board) - create(:backlog_list, board: board) - end end end |