Sha256: 600cf27368b2f36a48371341f72ee048edc17b513407a57d04de0998189b9a9a

Contents?: true

Size: 1.04 KB

Versions: 10

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

RSpec.describe "Remove Profile", type: [:request, :profile] do
  let(:finder_profile_repo)     { Arpa::Repositories::Profiles::Finder.new }
  let(:remover_profile_service) { Arpa::Services::Profiles::ProfileManagerRemover.new }
  let(:success_proc)            { ->(r) {} }
  let(:callback)                { {success: success_proc, fail: ->(e) {raise e} } }

  describe 'removing a Profile' do

    before do
      create :repository_profile
      remover_profile_service.remove(profile_params_to_remove, callback)
    end

    context 'when need destroy a Profile' do
      let(:profile_params_to_remove) { {profile: finder_profile_repo.all.first } }

      it 'record should be removed ' do
        expect(finder_profile_repo.all.size).to be == 0
      end

    end

    context 'when need disable a Profile' do
      let(:profile_params_to_remove) { {profile: finder_profile_repo.all.first, disable: true } }

      it 'record should be removed ' do
        expect(finder_profile_repo.all.size).to be == 0
      end

    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

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