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/detailed_status_type_spec.rb')
-rw-r--r--spec/graphql/types/ci/detailed_status_type_spec.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/spec/graphql/types/ci/detailed_status_type_spec.rb b/spec/graphql/types/ci/detailed_status_type_spec.rb
index ddb3a1450df..9fa3280657a 100644
--- a/spec/graphql/types/ci/detailed_status_type_spec.rb
+++ b/spec/graphql/types/ci/detailed_status_type_spec.rb
@@ -3,11 +3,30 @@
require 'spec_helper'
RSpec.describe Types::Ci::DetailedStatusType do
+ include GraphqlHelpers
+
specify { expect(described_class.graphql_name).to eq('DetailedStatus') }
- it "has all fields" do
+ it 'has all fields' do
expect(described_class).to have_graphql_fields(:group, :icon, :favicon,
:details_path, :has_details,
:label, :text, :tooltip, :action)
end
+
+ describe 'action field' do
+ it 'correctly renders the field' do
+ stage = create(:ci_stage_entity, status: :skipped)
+ status = stage.detailed_status(stage.pipeline.user)
+
+ expected_status = {
+ button_title: status.action_button_title,
+ icon: status.action_icon,
+ method: status.action_method,
+ path: status.action_path,
+ title: status.action_title
+ }
+
+ expect(resolve_field('action', status)).to eq(expected_status)
+ end
+ end
end