Sha256: a47cea611e00419507be40154b21d4332eed5961d79c9e2f348a64d69e05b1ad
Contents?: true
Size: 718 Bytes
Versions: 3
Compression:
Stored size: 718 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe SolidusGraphqlApi::Types::Base::Object do subject do Class.new(described_class) do graphql_name :test end end describe '.remove_field' do context 'when the field is defined' do before do subject.field :name, String, null: false end it 'removes the field' do expect { subject.remove_field :name }.to change { subject.own_fields['name'] }.to(nil) end end context 'when the field is not defined' do it 'raises an ArgumentError' do expect { subject.remove_field :name }.to raise_error(ArgumentError) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems