Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/graphql/types/ci/job_type_spec.rb')
-rw-r--r--spec/graphql/types/ci/job_type_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/graphql/types/ci/job_type_spec.rb b/spec/graphql/types/ci/job_type_spec.rb
index bc9e64282bc..b3dee082d1f 100644
--- a/spec/graphql/types/ci/job_type_spec.rb
+++ b/spec/graphql/types/ci/job_type_spec.rb
@@ -3,6 +3,8 @@
require 'spec_helper'
RSpec.describe Types::Ci::JobType do
+ include GraphqlHelpers
+
specify { expect(described_class.graphql_name).to eq('CiJob') }
specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Ci::Job) }
@@ -45,8 +47,21 @@ RSpec.describe Types::Ci::JobType do
tags
triggered
userPermissions
+ webPath
]
expect(described_class).to have_graphql_fields(*expected_fields)
end
+
+ describe '#web_path' do
+ subject { resolve_field(:web_path, build, current_user: user, object_type: described_class) }
+
+ let(:project) { create(:project) }
+ let(:user) { create(:user) }
+ let(:build) { create(:ci_build, project: project, user: user) }
+
+ it 'returns the web path of the job' do
+ is_expected.to eq("/#{project.full_path}/-/jobs/#{build.id}")
+ end
+ end
end