Sha256: c2c1fa01d40685ad62c2391e6a2eb223973961435be914735bcb14498fd44483
Contents?: true
Size: 890 Bytes
Versions: 26
Compression:
Stored size: 890 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::MutationFieldSetter do describe '#call' do subject(:prepared_operation) { described_class.new(field_type).call(operation, authenticatable: authenticatable) } let(:operation) { double(:operation) } let(:field_type) { double(:type) } context 'when resource is authtenticable' do let(:authenticatable) { true } it 'sets a field for the mutation' do expect(operation).to receive(:field).with(:authenticatable, field_type, null: false) prepared_operation end end context 'when resource is *NOT* authtenticable' do let(:authenticatable) { false } it 'does *NOT* set a field for the mutation' do expect(operation).not_to receive(:field) prepared_operation end end end end
Version data entries
26 entries across 26 versions & 1 rubygems