Sha256: 246ca6578c0aa8eb9e6f1aa9b34b923011cbfff8b143203539ae82e1bc8fba94

Contents?: true

Size: 941 Bytes

Versions: 9

Compression:

Stored size: 941 Bytes

Contents

require 'rails_helper'

RSpec.describe GraphqlDevise::MountMethod::OperationSanitizer do
  describe '.call' do
    subject { described_class.call(default: default, only: only, skipped: skipped) }

    let(:op_class1) { Class.new }
    let(:op_class2) { Class.new }
    let(:op_class3) { Class.new }

    context 'when the operations passed are mutations' do
      let(:skipped)  { [] }
      let(:only)     { [] }
      let(:default)  { { operation1: op_class1, operation2: op_class2 } }

      context 'when no other option besides default is passed' do
        it { is_expected.to eq(default) }
      end

      context 'when there are only operations' do
        let(:only) { [:operation1] }

        it { is_expected.to eq(operation1: op_class1) }
      end

      context 'when there are skipped operations' do
        let(:skipped) { [:operation2] }

        it { is_expected.to eq(operation1: op_class1) }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
graphql_devise-0.12.3 spec/services/mount_method/operation_sanitizer_spec.rb
graphql_devise-0.12.2 spec/services/mount_method/operation_sanitizer_spec.rb
graphql_devise-0.12.1 spec/services/mount_method/operation_sanitizer_spec.rb
graphql_devise-0.12.0 spec/services/mount_method/operation_sanitizer_spec.rb
graphql_devise-0.11.4 spec/services/mount_method/operation_sanitizer_spec.rb
graphql_devise-0.11.3 spec/services/mount_method/operation_sanitizer_spec.rb
graphql_devise-0.11.2 spec/services/mount_method/operation_sanitizer_spec.rb
graphql_devise-0.11.1 spec/services/mount_method/operation_sanitizer_spec.rb
graphql_devise-0.11.0 spec/services/mount_method/operation_sanitizer_spec.rb