Sha256: 36a4aca3e3a266c8d73a8e7e785b516bf40dd9753e0dec00854d70b8a82540b8

Contents?: true

Size: 1011 Bytes

Versions: 1

Compression:

Stored size: 1011 Bytes

Contents

require 'spec_helper'

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

    let(:logout_class) { Class.new(GraphQL::Schema::Resolver) }
    let(:mapping)      { :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

1 entries across 1 versions & 1 rubygems

Version Path
graphql_devise-0.12.0 spec/services/mount_method/operation_preparer_spec.rb