Sha256: 0b5410fb131477fdfb7a5ee5de11030deb0883ec3e265e8e784d0c48cdef12a3

Contents?: true

Size: 928 Bytes

Versions: 10

Compression:

Stored size: 928 Bytes

Contents

require 'spec_helper'

describe Arpa::Services::Profiles::ProfileManagerUpdater, type: :service, fast: true do

  let(:profile_updater) { double }
  let(:params)          { {profile: {name: 'profile_name', description: 'profile_description', role_ids: [1, 2]}} }
  let(:success_proc)    { ->(r) {} }
  let(:callback)        { {success: success_proc, fail: ->(e) {raise e} } }

  let(:setup_updaters) do
    allow(Arpa::Services::Profiles::Update::ProfileUpdater).to receive(:new).and_return(profile_updater)
  end

  let(:setup_updaters_methods) do
    allow(profile_updater).to receive(:update)
  end

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

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

  it 'profile_updater should call :update with parameters' do
    expect(profile_updater).to have_received(:update).with(params[:profile]).once
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

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