2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe GitlabSchema.types['SnippetBlob'] do
|
2020-03-13 15:44:24 +05:30
|
|
|
it 'has the correct fields' do
|
|
|
|
expected_fields = [:rich_data, :plain_data,
|
|
|
|
:raw_path, :size, :binary, :name, :path,
|
2020-05-24 23:13:21 +05:30
|
|
|
:simple_viewer, :rich_viewer, :mode, :external_storage,
|
|
|
|
:rendered_as_text]
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
expect(described_class).to have_graphql_fields(*expected_fields)
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
specify { expect(described_class.fields['richData'].type).not_to be_non_null }
|
|
|
|
specify { expect(described_class.fields['plainData'].type).not_to be_non_null }
|
|
|
|
specify { expect(described_class.fields['rawPath'].type).to be_non_null }
|
|
|
|
specify { expect(described_class.fields['size'].type).to be_non_null }
|
|
|
|
specify { expect(described_class.fields['binary'].type).to be_non_null }
|
|
|
|
specify { expect(described_class.fields['name'].type).not_to be_non_null }
|
|
|
|
specify { expect(described_class.fields['path'].type).not_to be_non_null }
|
|
|
|
specify { expect(described_class.fields['simpleViewer'].type).to be_non_null }
|
|
|
|
specify { expect(described_class.fields['richViewer'].type).not_to be_non_null }
|
|
|
|
specify { expect(described_class.fields['mode'].type).not_to be_non_null }
|
|
|
|
specify { expect(described_class.fields['externalStorage'].type).not_to be_non_null }
|
|
|
|
specify { expect(described_class.fields['renderedAsText'].type).to be_non_null }
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|