diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-17 21:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-17 21:09:01 +0300 |
commit | e388691e4a5b5b69be903c7eceb606b853719cd5 (patch) | |
tree | 97875b98a9a9c7b0dfe9245ce70d5e38ac3a3549 /spec/requests/api | |
parent | cb840235d7fb4001dab266c614bd2cf59036fe18 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api')
-rw-r--r-- | spec/requests/api/graphql/group/milestones_spec.rb | 36 | ||||
-rw-r--r-- | spec/requests/api/issue_links_spec.rb | 2 |
2 files changed, 29 insertions, 9 deletions
diff --git a/spec/requests/api/graphql/group/milestones_spec.rb b/spec/requests/api/graphql/group/milestones_spec.rb index 380eaea17f8..a5b489d72fd 100644 --- a/spec/requests/api/graphql/group/milestones_spec.rb +++ b/spec/requests/api/graphql/group/milestones_spec.rb @@ -9,12 +9,14 @@ RSpec.describe 'Milestones through GroupQuery' do let_it_be(:now) { Time.now } describe 'Get list of milestones from a group' do - let_it_be(:group) { create(:group) } + let_it_be(:parent_group) { create(:group) } + let_it_be(:group) { create(:group, parent: parent_group) } let_it_be(:milestone_1) { create(:milestone, group: group) } let_it_be(:milestone_2) { create(:milestone, group: group, state: :closed, start_date: now, due_date: now + 1.day) } let_it_be(:milestone_3) { create(:milestone, group: group, start_date: now, due_date: now + 2.days) } let_it_be(:milestone_4) { create(:milestone, group: group, state: :closed, start_date: now - 2.days, due_date: now - 1.day) } let_it_be(:milestone_from_other_group) { create(:milestone, group: create(:group)) } + let_it_be(:parent_milestone) { create(:milestone, group: parent_group) } let(:milestone_data) { graphql_data['group']['milestones']['edges'] } @@ -64,14 +66,32 @@ RSpec.describe 'Milestones through GroupQuery' do accessible_group.add_developer(user) end - it 'returns milestones also from subgroups and subprojects visible to user' do - fetch_milestones(user, args) + context 'when including decendants' do + let(:args) { { include_descendants: true } } + + it 'returns milestones also from subgroups and subprojects visible to user' do + fetch_milestones(user, args) + + expect_array_response( + milestone_1.to_global_id.to_s, milestone_2.to_global_id.to_s, + milestone_3.to_global_id.to_s, milestone_4.to_global_id.to_s, + submilestone_1.to_global_id.to_s, submilestone_2.to_global_id.to_s + ) + end + end + + context 'when including ancestors' do + let(:args) { { include_ancestors: true } } - expect_array_response( - milestone_1.to_global_id.to_s, milestone_2.to_global_id.to_s, - milestone_3.to_global_id.to_s, milestone_4.to_global_id.to_s, - submilestone_1.to_global_id.to_s, submilestone_2.to_global_id.to_s - ) + it 'returns milestones from ancestor groups' do + fetch_milestones(user, args) + + expect_array_response( + milestone_1.to_global_id.to_s, milestone_2.to_global_id.to_s, + milestone_3.to_global_id.to_s, milestone_4.to_global_id.to_s, + parent_milestone.to_global_id.to_s + ) + end end end diff --git a/spec/requests/api/issue_links_spec.rb b/spec/requests/api/issue_links_spec.rb index a4243766111..b64d395f25f 100644 --- a/spec/requests/api/issue_links_spec.rb +++ b/spec/requests/api/issue_links_spec.rb @@ -82,7 +82,7 @@ RSpec.describe API::IssueLinks do params: { target_project_id: unauthorized_project.id, target_issue_iid: target_issue.iid } expect(response).to have_gitlab_http_status(:not_found) - expect(json_response['message']).to eq('No Issue found for given params') + expect(json_response['message']).to eq('No matching issue found. Make sure that you are adding a valid issue URL.') end end |