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 @@
require 'spec_helper'
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
expected_fields = %i[
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expect(described_class.values.keys).to include(*%w[CRITICAL HIGH MEDIUM LOW INFO UNKNOWN])
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expect(described_class.values.keys).to include(*%w[TRIGGERED ACKNOWLEDGED RESOLVED IGNORED])
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
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
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expect(described_class.values.keys).to include(*%w[rich simple auxiliary])
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expected_fields = %w[id list_type position label]
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
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
expected_fields = %w[id name]
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expect(described_class).to have_graphql_fields(:group, :icon, :favicon,
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
......@@ -3,9 +3,9 @@
require 'spec_helper'
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
expect(described_class).to have_graphql_fields(
......
......@@ -3,11 +3,11 @@
require 'spec_helper'
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 }
it { 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['headSha'].type).to be_non_null }
specify { expect(described_class.fields['baseSha'].type).not_to be_non_null }
specify { expect(described_class.fields['startSha'].type).to be_non_null }
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expected_fields = %w[
......@@ -13,5 +13,5 @@ describe GitlabSchema.types['Environment'] do
expect(described_class).to have_graphql_fields(*expected_fields)
end
it { expect(described_class).to require_graphql_authorizations(:read_environment) }
specify { expect(described_class).to require_graphql_authorizations(:read_environment) }
end
......@@ -3,9 +3,9 @@
require 'spec_helper'
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
expected_fields = %i[
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
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
expected_fields = %i[
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expected_fields = %i[
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
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
expected_fields = %i[
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expected_fields = %i[
......
......@@ -14,9 +14,9 @@ describe GitlabSchema.types['GrafanaIntegration'] do
]
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
......@@ -3,11 +3,11 @@
require 'spec_helper'
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
expected_fields = %w[
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expect(described_class.values.keys).to include(
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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'
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
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'
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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'
end
......@@ -3,13 +3,13 @@
require 'spec_helper'
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
fields = %i[iid title description state reference author assignees participants labels milestone due_date
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expect(described_class).to have_graphql_fields(:jira_project_key, :createdAt, :scheduled_at, :scheduled_by)
......
......@@ -8,5 +8,5 @@ describe GitlabSchema.types['Label'] do
expect(described_class).to have_graphql_fields(*expected_fields)
end
it { expect(described_class).to require_graphql_authorizations(:read_label) }
specify { expect(described_class).to require_graphql_authorizations(:read_label) }
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
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'
......
......@@ -3,11 +3,11 @@
require 'spec_helper'
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
expected_fields = %w[
......
......@@ -3,6 +3,6 @@
require 'spec_helper'
describe GitlabSchema.types['Metadata'] do
it { expect(described_class.graphql_name).to eq('Metadata') }
it { expect(described_class).to require_graphql_authorizations(:read_instance_metadata) }
specify { expect(described_class.graphql_name).to eq('Metadata') }
specify { expect(described_class).to require_graphql_authorizations(:read_instance_metadata) }
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expected_fields = %w[
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expected_fields = %w[
......@@ -13,5 +13,5 @@ describe GitlabSchema.types['MetricsDashboardAnnotation'] do
expect(described_class).to have_graphql_fields(*expected_fields)
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
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expected_fields = %w[
......@@ -14,5 +14,5 @@ describe GitlabSchema.types['Namespace'] do
expect(described_class).to have_graphql_fields(*expected_fields)
end
it { expect(described_class).to require_graphql_authorizations(:read_namespace) }
specify { expect(described_class).to require_graphql_authorizations(:read_namespace) }
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
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
......@@ -10,6 +10,6 @@ describe GitlabSchema.types['Note'] do
expect(described_class).to have_graphql_fields(*expected_fields)
end
it { 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 expose_permissions_using(Types::PermissionTypes::Note) }
specify { expect(described_class).to require_graphql_authorizations(:read_note) }
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
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
it 'knows the correct type for objects' do
......
......@@ -3,5 +3,5 @@
require 'spec_helper'
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
......@@ -3,11 +3,11 @@
require 'spec_helper'
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
expected_fields = %w[
......
......@@ -3,11 +3,11 @@
require 'spec_helper'
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
expect(described_class).to have_graphql_fields(:type, :active)
end
it { expect(described_class).to require_graphql_authorizations(:admin_project) }
specify { expect(described_class).to require_graphql_authorizations(:admin_project) }
end
......@@ -3,11 +3,11 @@
require 'spec_helper'
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
expect(described_class).to have_graphql_fields(:type, :active)
end
it { expect(described_class).to require_graphql_authorizations(:admin_project) }
specify { expect(described_class).to require_graphql_authorizations(:admin_project) }
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
it 'resolves the corresponding type for objects' do
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expect(described_class.values.keys).to match_array(available_services_enum)
......
......@@ -3,11 +3,11 @@
require 'spec_helper'
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
......@@ -3,12 +3,12 @@
require 'spec_helper'
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
expect(described_class).to have_graphql_fields(:storage_size, :repository_size, :lfs_objects_size,
:build_artifacts_size, :packages_size, :wiki_size)
end
it { expect(described_class).to require_graphql_authorizations(:read_statistics) }
specify { expect(described_class).to require_graphql_authorizations(:read_statistics) }
end
......@@ -17,7 +17,7 @@ describe GitlabSchema.types['Snippet'] do
end
describe 'authorizations' do
it { expect(described_class).to require_graphql_authorizations(:read_snippet) }
specify { expect(described_class).to require_graphql_authorizations(:read_snippet) }
end
shared_examples 'response without repository URLs' do
......
......@@ -6,7 +6,7 @@ describe GitlabSchema.types['Time'] do
let(:iso) { "2018-06-04T15:23:50+02:00" }
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
expect(described_class.coerce_isolated_result(time)).to eq(iso)
......
......@@ -9,5 +9,5 @@ describe GitlabSchema.types['Todo'] do
expect(described_class).to have_graphql_fields(*expected_fields)
end
it { expect(described_class).to require_graphql_authorizations(:read_todo) }
specify { expect(described_class).to require_graphql_authorizations(:read_todo) }
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
......@@ -3,7 +3,7 @@
require 'spec_helper'
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
expect(described_class.values.keys).to include(*%w[tree blob commit])
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
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
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