Sha256: f5e2445ed0cc35c3ba253ab6da473214ee8366aff3f162c4a60aeca2a3803477

Contents?: true

Size: 1013 Bytes

Versions: 5

Compression:

Stored size: 1013 Bytes

Contents

require 'spec_helper'

RSpec.describe GraphqlDevise::MountMethod::OperationPreparer do
  describe '#call' do
    subject(:prepared_operations) do
      described_class.new(
        resource:              resource,
        selected_operations:   selected,
        preparer:              preparer,
        custom:                custom,
        additional_operations: additional
      ).call
    end

    let(:logout_class) { Class.new(GraphQL::Schema::Resolver) }
    let(:resource)     { 'User' }
    let(:selected)     { { login: double(:login_default), logout: logout_class } }
    let(:preparer)     { double(:preparer, call: logout_class) }
    let(:custom)       { { login: double(:custom_login, graphql_name: nil) } }
    let(:additional)   { { user_additional: double(:user_additional) } }

    it 'is expected to return all provided operation keys' do
      expect(prepared_operations.keys).to contain_exactly(
        :user_login,
        :user_logout,
        :user_additional
      )
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
graphql_devise-0.11.4 spec/services/mount_method/operation_preparer_spec.rb
graphql_devise-0.11.3 spec/services/mount_method/operation_preparer_spec.rb
graphql_devise-0.11.2 spec/services/mount_method/operation_preparer_spec.rb
graphql_devise-0.11.1 spec/services/mount_method/operation_preparer_spec.rb
graphql_devise-0.11.0 spec/services/mount_method/operation_preparer_spec.rb