Commit ff8d8907 authored by Sean Arnold's avatar Sean Arnold

Update single spec syntax to use specify

- Limited to GraphQL specs
- Bulk update of existing specs

Fix indentation
parent 8e41b1c4
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['AlertManagementAlert'] do describe GitlabSchema.types['AlertManagementAlert'] do
it { expect(described_class.graphql_name).to eq('AlertManagementAlert') } specify { expect(described_class.graphql_name).to eq('AlertManagementAlert') }
it { expect(described_class).to require_graphql_authorizations(:read_alert_management_alerts) } specify { expect(described_class).to require_graphql_authorizations(:read_alert_management_alerts) }
it 'exposes the expected fields' do it 'exposes the expected fields' do
expected_fields = %i[ expected_fields = %i[
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['AlertManagementSeverity'] do describe GitlabSchema.types['AlertManagementSeverity'] do
it { expect(described_class.graphql_name).to eq('AlertManagementSeverity') } specify { expect(described_class.graphql_name).to eq('AlertManagementSeverity') }
it 'exposes all the severity values' do it 'exposes all the severity values' do
expect(described_class.values.keys).to include(*%w[CRITICAL HIGH MEDIUM LOW INFO UNKNOWN]) expect(described_class.values.keys).to include(*%w[CRITICAL HIGH MEDIUM LOW INFO UNKNOWN])
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['AlertManagementStatus'] do describe GitlabSchema.types['AlertManagementStatus'] do
it { expect(described_class.graphql_name).to eq('AlertManagementStatus') } specify { expect(described_class.graphql_name).to eq('AlertManagementStatus') }
it 'exposes all the severity values' do it 'exposes all the severity values' do
expect(described_class.values.keys).to include(*%w[TRIGGERED ACKNOWLEDGED RESOLVED IGNORED]) expect(described_class.values.keys).to include(*%w[TRIGGERED ACKNOWLEDGED RESOLVED IGNORED])
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['AwardEmoji'] do describe GitlabSchema.types['AwardEmoji'] do
it { expect(described_class.graphql_name).to eq('AwardEmoji') } specify { expect(described_class.graphql_name).to eq('AwardEmoji') }
it { expect(described_class).to require_graphql_authorizations(:read_emoji) } specify { expect(described_class).to require_graphql_authorizations(:read_emoji) }
it { expect(described_class).to have_graphql_fields(:description, :unicode_version, :emoji, :name, :unicode, :user) } specify { expect(described_class).to have_graphql_fields(:description, :unicode_version, :emoji, :name, :unicode, :user) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::BlobViewers::TypeEnum do describe Types::BlobViewers::TypeEnum do
it { expect(described_class.graphql_name).to eq('BlobViewersType') } specify { expect(described_class.graphql_name).to eq('BlobViewersType') }
it 'exposes all tree entry types' do it 'exposes all tree entry types' do
expect(described_class.values.keys).to include(*%w[rich simple auxiliary]) expect(described_class.values.keys).to include(*%w[rich simple auxiliary])
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['BoardList'] do describe GitlabSchema.types['BoardList'] do
it { expect(described_class.graphql_name).to eq('BoardList') } specify { expect(described_class.graphql_name).to eq('BoardList') }
it 'has specific fields' do it 'has specific fields' do
expected_fields = %w[id list_type position label] expected_fields = %w[id list_type position label]
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Board'] do describe GitlabSchema.types['Board'] do
it { expect(described_class.graphql_name).to eq('Board') } specify { expect(described_class.graphql_name).to eq('Board') }
it { expect(described_class).to require_graphql_authorizations(:read_board) } specify { expect(described_class).to require_graphql_authorizations(:read_board) }
it 'has specific fields' do it 'has specific fields' do
expected_fields = %w[id name] expected_fields = %w[id name]
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::Ci::DetailedStatusType do describe Types::Ci::DetailedStatusType do
it { expect(described_class.graphql_name).to eq('DetailedStatus') } 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, expect(described_class).to have_graphql_fields(:group, :icon, :favicon,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::Ci::PipelineType do describe Types::Ci::PipelineType do
it { expect(described_class.graphql_name).to eq('Pipeline') } specify { expect(described_class.graphql_name).to eq('Pipeline') }
it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Ci::Pipeline) } specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Ci::Pipeline) }
end end
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Commit'] do describe GitlabSchema.types['Commit'] do
it { expect(described_class.graphql_name).to eq('Commit') } specify { expect(described_class.graphql_name).to eq('Commit') }
it { expect(described_class).to require_graphql_authorizations(:download_code) } specify { expect(described_class).to require_graphql_authorizations(:download_code) }
it 'contains attributes related to commit' do it 'contains attributes related to commit' do
expect(described_class).to have_graphql_fields( expect(described_class).to have_graphql_fields(
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['DiffRefs'] do describe GitlabSchema.types['DiffRefs'] do
it { expect(described_class.graphql_name).to eq('DiffRefs') } specify { expect(described_class.graphql_name).to eq('DiffRefs') }
it { expect(described_class).to have_graphql_fields(:head_sha, :base_sha, :start_sha).only } specify { expect(described_class).to have_graphql_fields(:head_sha, :base_sha, :start_sha).only }
it { expect(described_class.fields['headSha'].type).to be_non_null } specify { expect(described_class.fields['headSha'].type).to be_non_null }
it { expect(described_class.fields['baseSha'].type).not_to be_non_null } specify { expect(described_class.fields['baseSha'].type).not_to be_non_null }
it { expect(described_class.fields['startSha'].type).to be_non_null } specify { expect(described_class.fields['startSha'].type).to be_non_null }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Environment'] do describe GitlabSchema.types['Environment'] do
it { expect(described_class.graphql_name).to eq('Environment') } specify { expect(described_class.graphql_name).to eq('Environment') }
it 'has the expected fields' do it 'has the expected fields' do
expected_fields = %w[ expected_fields = %w[
...@@ -13,5 +13,5 @@ describe GitlabSchema.types['Environment'] do ...@@ -13,5 +13,5 @@ describe GitlabSchema.types['Environment'] do
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_graphql_fields(*expected_fields)
end end
it { expect(described_class).to require_graphql_authorizations(:read_environment) } specify { expect(described_class).to require_graphql_authorizations(:read_environment) }
end end
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['SentryDetailedError'] do describe GitlabSchema.types['SentryDetailedError'] do
it { expect(described_class.graphql_name).to eq('SentryDetailedError') } specify { expect(described_class.graphql_name).to eq('SentryDetailedError') }
it { expect(described_class).to require_graphql_authorizations(:read_sentry_issue) } specify { expect(described_class).to require_graphql_authorizations(:read_sentry_issue) }
it 'exposes the expected fields' do it 'exposes the expected fields' do
expected_fields = %i[ expected_fields = %i[
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['SentryErrorCollection'] do describe GitlabSchema.types['SentryErrorCollection'] do
it { expect(described_class.graphql_name).to eq('SentryErrorCollection') } specify { expect(described_class.graphql_name).to eq('SentryErrorCollection') }
it { expect(described_class).to require_graphql_authorizations(:read_sentry_issue) } specify { expect(described_class).to require_graphql_authorizations(:read_sentry_issue) }
it 'exposes the expected fields' do it 'exposes the expected fields' do
expected_fields = %i[ expected_fields = %i[
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['SentryErrorStackTraceEntry'] do describe GitlabSchema.types['SentryErrorStackTraceEntry'] do
it { expect(described_class.graphql_name).to eq('SentryErrorStackTraceEntry') } specify { expect(described_class.graphql_name).to eq('SentryErrorStackTraceEntry') }
it 'exposes the expected fields' do it 'exposes the expected fields' do
expected_fields = %i[ expected_fields = %i[
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['SentryErrorStackTrace'] do describe GitlabSchema.types['SentryErrorStackTrace'] do
it { expect(described_class.graphql_name).to eq('SentryErrorStackTrace') } specify { expect(described_class.graphql_name).to eq('SentryErrorStackTrace') }
it { expect(described_class).to require_graphql_authorizations(:read_sentry_issue) } specify { expect(described_class).to require_graphql_authorizations(:read_sentry_issue) }
it 'exposes the expected fields' do it 'exposes the expected fields' do
expected_fields = %i[ expected_fields = %i[
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['SentryError'] do describe GitlabSchema.types['SentryError'] do
it { expect(described_class.graphql_name).to eq('SentryError') } specify { expect(described_class.graphql_name).to eq('SentryError') }
it 'exposes the expected fields' do it 'exposes the expected fields' do
expected_fields = %i[ expected_fields = %i[
......
...@@ -14,9 +14,9 @@ describe GitlabSchema.types['GrafanaIntegration'] do ...@@ -14,9 +14,9 @@ describe GitlabSchema.types['GrafanaIntegration'] do
] ]
end end
it { expect(described_class.graphql_name).to eq('GrafanaIntegration') } specify { expect(described_class.graphql_name).to eq('GrafanaIntegration') }
it { expect(described_class).to require_graphql_authorizations(:admin_operations) } specify { expect(described_class).to require_graphql_authorizations(:admin_operations) }
it { expect(described_class).to have_graphql_fields(*expected_fields) } specify { expect(described_class).to have_graphql_fields(*expected_fields) }
end end
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Group'] do describe GitlabSchema.types['Group'] do
it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Group) } specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Group) }
it { expect(described_class.graphql_name).to eq('Group') } specify { expect(described_class.graphql_name).to eq('Group') }
it { expect(described_class).to require_graphql_authorizations(:read_group) } specify { expect(described_class).to require_graphql_authorizations(:read_group) }
it 'has the expected fields' do it 'has the expected fields' do
expected_fields = %w[ expected_fields = %w[
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::IssuableSortEnum do describe Types::IssuableSortEnum do
it { expect(described_class.graphql_name).to eq('IssuableSort') } specify { expect(described_class.graphql_name).to eq('IssuableSort') }
it 'exposes all the existing issuable sort values' do it 'exposes all the existing issuable sort values' do
expect(described_class.values.keys).to include( expect(described_class.values.keys).to include(
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['IssuableState'] do describe GitlabSchema.types['IssuableState'] do
it { expect(described_class.graphql_name).to eq('IssuableState') } specify { expect(described_class.graphql_name).to eq('IssuableState') }
it_behaves_like 'issuable state' it_behaves_like 'issuable state'
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['IssueSort'] do describe GitlabSchema.types['IssueSort'] do
it { expect(described_class.graphql_name).to eq('IssueSort') } specify { expect(described_class.graphql_name).to eq('IssueSort') }
it_behaves_like 'common sort values' it_behaves_like 'common sort values'
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['IssueState'] do describe GitlabSchema.types['IssueState'] do
it { expect(described_class.graphql_name).to eq('IssueState') } specify { expect(described_class.graphql_name).to eq('IssueState') }
it_behaves_like 'issuable state' it_behaves_like 'issuable state'
end end
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Issue'] do describe GitlabSchema.types['Issue'] do
it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Issue) } specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Issue) }
it { expect(described_class.graphql_name).to eq('Issue') } specify { expect(described_class.graphql_name).to eq('Issue') }
it { expect(described_class).to require_graphql_authorizations(:read_issue) } specify { expect(described_class).to require_graphql_authorizations(:read_issue) }
it { expect(described_class.interfaces).to include(Types::Notes::NoteableType) } specify { expect(described_class.interfaces).to include(Types::Notes::NoteableType) }
it 'has specific fields' do it 'has specific fields' do
fields = %i[iid title description state reference author assignees participants labels milestone due_date fields = %i[iid title description state reference author assignees participants labels milestone due_date
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['JiraImport'] do describe GitlabSchema.types['JiraImport'] do
it { expect(described_class.graphql_name).to eq('JiraImport') } specify { expect(described_class.graphql_name).to eq('JiraImport') }
it 'has the expected fields' do it 'has the expected fields' do
expect(described_class).to have_graphql_fields(:jira_project_key, :createdAt, :scheduled_at, :scheduled_by) expect(described_class).to have_graphql_fields(:jira_project_key, :createdAt, :scheduled_at, :scheduled_by)
......
...@@ -8,5 +8,5 @@ describe GitlabSchema.types['Label'] do ...@@ -8,5 +8,5 @@ describe GitlabSchema.types['Label'] do
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_graphql_fields(*expected_fields)
end end
it { expect(described_class).to require_graphql_authorizations(:read_label) } specify { expect(described_class).to require_graphql_authorizations(:read_label) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['MergeRequestState'] do describe GitlabSchema.types['MergeRequestState'] do
it { expect(described_class.graphql_name).to eq('MergeRequestState') } specify { expect(described_class.graphql_name).to eq('MergeRequestState') }
it_behaves_like 'issuable state' it_behaves_like 'issuable state'
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['MergeRequest'] do describe GitlabSchema.types['MergeRequest'] do
it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::MergeRequest) } specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::MergeRequest) }
it { expect(described_class).to require_graphql_authorizations(:read_merge_request) } specify { expect(described_class).to require_graphql_authorizations(:read_merge_request) }
it { expect(described_class.interfaces).to include(Types::Notes::NoteableType) } specify { expect(described_class.interfaces).to include(Types::Notes::NoteableType) }
it 'has the expected fields' do it 'has the expected fields' do
expected_fields = %w[ expected_fields = %w[
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Metadata'] do describe GitlabSchema.types['Metadata'] do
it { expect(described_class.graphql_name).to eq('Metadata') } specify { expect(described_class.graphql_name).to eq('Metadata') }
it { expect(described_class).to require_graphql_authorizations(:read_instance_metadata) } specify { expect(described_class).to require_graphql_authorizations(:read_instance_metadata) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['MetricsDashboard'] do describe GitlabSchema.types['MetricsDashboard'] do
it { expect(described_class.graphql_name).to eq('MetricsDashboard') } specify { expect(described_class.graphql_name).to eq('MetricsDashboard') }
it 'has the expected fields' do it 'has the expected fields' do
expected_fields = %w[ expected_fields = %w[
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['MetricsDashboardAnnotation'] do describe GitlabSchema.types['MetricsDashboardAnnotation'] do
it { expect(described_class.graphql_name).to eq('MetricsDashboardAnnotation') } specify { expect(described_class.graphql_name).to eq('MetricsDashboardAnnotation') }
it 'has the expected fields' do it 'has the expected fields' do
expected_fields = %w[ expected_fields = %w[
...@@ -13,5 +13,5 @@ describe GitlabSchema.types['MetricsDashboardAnnotation'] do ...@@ -13,5 +13,5 @@ describe GitlabSchema.types['MetricsDashboardAnnotation'] do
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_graphql_fields(*expected_fields)
end end
it { expect(described_class).to require_graphql_authorizations(:read_metrics_dashboard_annotation) } specify { expect(described_class).to require_graphql_authorizations(:read_metrics_dashboard_annotation) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Milestone'] do describe GitlabSchema.types['Milestone'] do
it { expect(described_class.graphql_name).to eq('Milestone') } specify { expect(described_class.graphql_name).to eq('Milestone') }
it { expect(described_class).to require_graphql_authorizations(:read_milestone) } specify { expect(described_class).to require_graphql_authorizations(:read_milestone) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Namespace'] do describe GitlabSchema.types['Namespace'] do
it { expect(described_class.graphql_name).to eq('Namespace') } specify { expect(described_class.graphql_name).to eq('Namespace') }
it 'has the expected fields' do it 'has the expected fields' do
expected_fields = %w[ expected_fields = %w[
...@@ -14,5 +14,5 @@ describe GitlabSchema.types['Namespace'] do ...@@ -14,5 +14,5 @@ describe GitlabSchema.types['Namespace'] do
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_graphql_fields(*expected_fields)
end end
it { expect(described_class).to require_graphql_authorizations(:read_namespace) } specify { expect(described_class).to require_graphql_authorizations(:read_namespace) }
end end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Discussion'] do describe GitlabSchema.types['Discussion'] do
it { expect(described_class).to have_graphql_fields(:id, :created_at, :notes, :reply_id) } specify { expect(described_class).to have_graphql_fields(:id, :created_at, :notes, :reply_id) }
it { expect(described_class).to require_graphql_authorizations(:read_note) } specify { expect(described_class).to require_graphql_authorizations(:read_note) }
end end
...@@ -10,6 +10,6 @@ describe GitlabSchema.types['Note'] do ...@@ -10,6 +10,6 @@ describe GitlabSchema.types['Note'] do
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_graphql_fields(*expected_fields)
end end
it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Note) } specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Note) }
it { expect(described_class).to require_graphql_authorizations(:read_note) } specify { expect(described_class).to require_graphql_authorizations(:read_note) }
end end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::Notes::NoteableType do describe Types::Notes::NoteableType do
it { expect(described_class).to have_graphql_fields(:notes, :discussions) } specify { expect(described_class).to have_graphql_fields(:notes, :discussions) }
describe ".resolve_type" do describe ".resolve_type" do
it 'knows the correct type for objects' do it 'knows the correct type for objects' do
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
require 'spec_helper' require 'spec_helper'
describe Types::MergeRequestType do describe Types::MergeRequestType do
it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::MergeRequest) } specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::MergeRequest) }
end end
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Project'] do describe GitlabSchema.types['Project'] do
it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Project) } specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Project) }
it { expect(described_class.graphql_name).to eq('Project') } specify { expect(described_class.graphql_name).to eq('Project') }
it { expect(described_class).to require_graphql_authorizations(:read_project) } specify { expect(described_class).to require_graphql_authorizations(:read_project) }
it 'has the expected fields' do it 'has the expected fields' do
expected_fields = %w[ expected_fields = %w[
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['BaseService'] do describe GitlabSchema.types['BaseService'] do
it { expect(described_class.graphql_name).to eq('BaseService') } specify { expect(described_class.graphql_name).to eq('BaseService') }
it 'has basic expected fields' do it 'has basic expected fields' do
expect(described_class).to have_graphql_fields(:type, :active) expect(described_class).to have_graphql_fields(:type, :active)
end end
it { expect(described_class).to require_graphql_authorizations(:admin_project) } specify { expect(described_class).to require_graphql_authorizations(:admin_project) }
end end
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['JiraService'] do describe GitlabSchema.types['JiraService'] do
it { expect(described_class.graphql_name).to eq('JiraService') } specify { expect(described_class.graphql_name).to eq('JiraService') }
it 'has basic expected fields' do it 'has basic expected fields' do
expect(described_class).to have_graphql_fields(:type, :active) expect(described_class).to have_graphql_fields(:type, :active)
end end
it { expect(described_class).to require_graphql_authorizations(:admin_project) } specify { expect(described_class).to require_graphql_authorizations(:admin_project) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::Projects::ServiceType do describe Types::Projects::ServiceType do
it { expect(described_class).to have_graphql_fields(:type, :active) } specify { expect(described_class).to have_graphql_fields(:type, :active) }
describe ".resolve_type" do describe ".resolve_type" do
it 'resolves the corresponding type for objects' do it 'resolves the corresponding type for objects' do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['ServiceType'] do describe GitlabSchema.types['ServiceType'] do
it { expect(described_class.graphql_name).to eq('ServiceType') } specify { expect(described_class.graphql_name).to eq('ServiceType') }
it 'exposes all the existing project services' do it 'exposes all the existing project services' do
expect(described_class.values.keys).to match_array(available_services_enum) expect(described_class.values.keys).to match_array(available_services_enum)
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['Repository'] do describe GitlabSchema.types['Repository'] do
it { expect(described_class.graphql_name).to eq('Repository') } specify { expect(described_class.graphql_name).to eq('Repository') }
it { expect(described_class).to require_graphql_authorizations(:download_code) } specify { expect(described_class).to require_graphql_authorizations(:download_code) }
it { expect(described_class).to have_graphql_field(:root_ref) } specify { expect(described_class).to have_graphql_field(:root_ref) }
it { expect(described_class).to have_graphql_field(:tree) } specify { expect(described_class).to have_graphql_field(:tree) }
end end
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['RootStorageStatistics'] do describe GitlabSchema.types['RootStorageStatistics'] do
it { expect(described_class.graphql_name).to eq('RootStorageStatistics') } specify { expect(described_class.graphql_name).to eq('RootStorageStatistics') }
it 'has all the required fields' do it 'has all the required fields' do
expect(described_class).to have_graphql_fields(:storage_size, :repository_size, :lfs_objects_size, expect(described_class).to have_graphql_fields(:storage_size, :repository_size, :lfs_objects_size,
:build_artifacts_size, :packages_size, :wiki_size) :build_artifacts_size, :packages_size, :wiki_size)
end end
it { expect(described_class).to require_graphql_authorizations(:read_statistics) } specify { expect(described_class).to require_graphql_authorizations(:read_statistics) }
end end
...@@ -17,7 +17,7 @@ describe GitlabSchema.types['Snippet'] do ...@@ -17,7 +17,7 @@ describe GitlabSchema.types['Snippet'] do
end end
describe 'authorizations' do describe 'authorizations' do
it { expect(described_class).to require_graphql_authorizations(:read_snippet) } specify { expect(described_class).to require_graphql_authorizations(:read_snippet) }
end end
shared_examples 'response without repository URLs' do shared_examples 'response without repository URLs' do
......
...@@ -6,7 +6,7 @@ describe GitlabSchema.types['Time'] do ...@@ -6,7 +6,7 @@ describe GitlabSchema.types['Time'] do
let(:iso) { "2018-06-04T15:23:50+02:00" } let(:iso) { "2018-06-04T15:23:50+02:00" }
let(:time) { Time.parse(iso) } let(:time) { Time.parse(iso) }
it { expect(described_class.graphql_name).to eq('Time') } specify { expect(described_class.graphql_name).to eq('Time') }
it 'coerces Time object into ISO 8601' do it 'coerces Time object into ISO 8601' do
expect(described_class.coerce_isolated_result(time)).to eq(iso) expect(described_class.coerce_isolated_result(time)).to eq(iso)
......
...@@ -9,5 +9,5 @@ describe GitlabSchema.types['Todo'] do ...@@ -9,5 +9,5 @@ describe GitlabSchema.types['Todo'] do
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_graphql_fields(*expected_fields)
end end
it { expect(described_class).to require_graphql_authorizations(:read_todo) } specify { expect(described_class).to require_graphql_authorizations(:read_todo) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::Tree::BlobType do describe Types::Tree::BlobType do
it { expect(described_class.graphql_name).to eq('Blob') } specify { expect(described_class.graphql_name).to eq('Blob') }
it { expect(described_class).to have_graphql_fields(:id, :sha, :name, :type, :path, :flat_path, :web_url, :lfs_oid) } specify { expect(described_class).to have_graphql_fields(:id, :sha, :name, :type, :path, :flat_path, :web_url, :lfs_oid) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::Tree::SubmoduleType do describe Types::Tree::SubmoduleType do
it { expect(described_class.graphql_name).to eq('Submodule') } specify { expect(described_class.graphql_name).to eq('Submodule') }
it { expect(described_class).to have_graphql_fields(:id, :sha, :name, :type, :path, :flat_path, :web_url, :tree_url) } specify { expect(described_class).to have_graphql_fields(:id, :sha, :name, :type, :path, :flat_path, :web_url, :tree_url) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::Tree::TreeEntryType do describe Types::Tree::TreeEntryType do
it { expect(described_class.graphql_name).to eq('TreeEntry') } specify { expect(described_class.graphql_name).to eq('TreeEntry') }
it { expect(described_class).to have_graphql_fields(:id, :sha, :name, :type, :path, :flat_path, :web_url) } specify { expect(described_class).to have_graphql_fields(:id, :sha, :name, :type, :path, :flat_path, :web_url) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::Tree::TreeType do describe Types::Tree::TreeType do
it { expect(described_class.graphql_name).to eq('Tree') } specify { expect(described_class.graphql_name).to eq('Tree') }
it { expect(described_class).to have_graphql_fields(:trees, :submodules, :blobs, :last_commit) } specify { expect(described_class).to have_graphql_fields(:trees, :submodules, :blobs, :last_commit) }
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe Types::Tree::TypeEnum do describe Types::Tree::TypeEnum do
it { expect(described_class.graphql_name).to eq('EntryType') } specify { expect(described_class.graphql_name).to eq('EntryType') }
it 'exposes all tree entry types' do it 'exposes all tree entry types' do
expect(described_class.values.keys).to include(*%w[tree blob commit]) expect(described_class.values.keys).to include(*%w[tree blob commit])
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe GitlabSchema.types['User'] do describe GitlabSchema.types['User'] do
it { expect(described_class.graphql_name).to eq('User') } specify { expect(described_class.graphql_name).to eq('User') }
it { expect(described_class).to require_graphql_authorizations(:read_user) } specify { expect(described_class).to require_graphql_authorizations(:read_user) }
it 'has the expected fields' do it 'has the expected fields' do
expected_fields = %w[ expected_fields = %w[
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment