diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /spec/requests/api/graphql/ci/runner_web_url_edge_spec.rb | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'spec/requests/api/graphql/ci/runner_web_url_edge_spec.rb')
-rw-r--r-- | spec/requests/api/graphql/ci/runner_web_url_edge_spec.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/spec/requests/api/graphql/ci/runner_web_url_edge_spec.rb b/spec/requests/api/graphql/ci/runner_web_url_edge_spec.rb index e84a1ca4cc4..76e2dda4ce2 100644 --- a/spec/requests/api/graphql/ci/runner_web_url_edge_spec.rb +++ b/spec/requests/api/graphql/ci/runner_web_url_edge_spec.rb @@ -25,16 +25,22 @@ RSpec.describe 'RunnerWebUrlEdge', feature_category: :runner_fleet do GQL end - before do + subject(:request) do post_graphql(query, current_user: user, variables: { path: group.full_path }) end context 'with an authorized user' do let(:user) { create_default(:user, :admin) } - it_behaves_like 'a working graphql query' + it_behaves_like 'a working graphql query' do + before do + request + end + end it 'returns correct URLs' do + request + expect(edges_graphql_data).to match_array [ { 'editUrl' => Gitlab::Routing.url_helpers.edit_group_runner_url(group, group_runner), @@ -47,10 +53,14 @@ RSpec.describe 'RunnerWebUrlEdge', feature_category: :runner_fleet do context 'with an unauthorized user' do let(:user) { create(:user) } - it_behaves_like 'a working graphql query' + it 'returns nil runners and an error' do + request - it 'returns no edges' do - expect(edges_graphql_data).to be_empty + expect(graphql_data.dig('group', 'runners')).to be_nil + expect(graphql_errors).to contain_exactly(a_hash_including( + 'message' => a_string_including("you don't have permission to perform this action"), + 'path' => %w[group runners] + )) end end end |