2019-09-30 21:07:59 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Graphql::CopyFieldDescription do
|
2019-09-30 21:07:59 +05:30
|
|
|
subject { Class.new.include(described_class) }
|
|
|
|
|
|
|
|
describe '.copy_field_description' do
|
|
|
|
let(:type) do
|
|
|
|
Class.new(Types::BaseObject) do
|
|
|
|
graphql_name "TestType"
|
|
|
|
|
|
|
|
field :field_name, GraphQL::STRING_TYPE, null: true, description: 'Foo'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns the correct description' do
|
|
|
|
expect(subject.copy_field_description(type, :field_name)).to eq('Foo')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|