Sha256: 8b2331b18ee87634c8f87880d36486a060de27aefd1138d0a5e646d0926a2c4b

Contents?: true

Size: 844 Bytes

Versions: 10

Compression:

Stored size: 844 Bytes

Contents

require 'spec_helper'

describe Arpa::Services::Roles::RoleManagerRemover, type: :service, fast: true do

  let(:role_remover) { double }
  let(:role)         { double }
  let(:params)       { {role: role} }
  let(:success_proc) { ->(r) {} }
  let(:callback)     { {success: success_proc, fail: ->(e) {raise e} } }

  let(:setup_updaters) do
    allow(Arpa::Services::Roles::Remove::RoleRemover).to receive(:new).and_return(role_remover)
  end

  let(:setup_updaters_methods) do
    allow(role_remover).to receive(:remove)
  end

  let(:result) { subject.remove params, callback }

  before do
    setup_updaters
    setup_updaters_methods
    allow(success_proc).to receive(:call)
    result
  end

  it 'role_remover should call :remove with role as parameter' do
    expect(role_remover).to have_received(:remove).with(role).once
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
arpa-0.2.0 spec/lib/arpa/services/roles/role_manager_remover_spec.rb
arpa-0.1.0 spec/lib/arpa/services/roles/role_manager_remover_spec.rb
arpa-0.0.9 spec/lib/arpa/services/roles/role_manager_remover_spec.rb
arpa-0.0.8 spec/lib/ar/services/roles/role_manager_remover_spec.rb
arpa-0.0.7 spec/lib/ar/services/roles/role_manager_remover_spec.rb
arpa-0.0.6 spec/lib/ar/services/roles/role_manager_remover_spec.rb
arpa-0.0.5 spec/lib/ar/services/roles/role_manager_remover_spec.rb
arpa-0.0.4 spec/lib/ar/services/roles/role_manager_remover_spec.rb
arpa-0.0.3 spec/lib/ar/services/roles/role_manager_remover_spec.rb
arpa-0.0.2 spec/lib/ar/services/roles/role_manager_remover_spec.rb