Sha256: a49d6d2993e2464a88d1953a3f7fdb674718454ad495c63ad67d3e2ff0d317c0

Contents?: true

Size: 1014 Bytes

Versions: 13

Compression:

Stored size: 1014 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'g5_authenticatable:purge_users' do
  include_context 'rake'

  context 'when there are no local users' do
    it 'should not raise any errors' do
      expect { task.invoke }.to_not raise_error
    end

    it 'should not leave any user data in the db' do
      task.invoke
      expect(G5Authenticatable::User.count).to eq(0)
    end
  end

  context 'when there is one local user' do
    let!(:user) { FactoryBot.create(:g5_authenticatable_user) }

    it 'should delete the user data from the db' do
      expect { task.invoke }.to change { G5Authenticatable::User.count }.from(1).to(0)
    end
  end

  context 'when there are multiple local users' do
    let!(:user1) { FactoryBot.create(:g5_authenticatable_user) }
    let!(:user2) { FactoryBot.create(:g5_authenticatable_user) }

    it 'should delete the user data from the db' do
      expect { task.invoke }.to change { G5Authenticatable::User.count }.from(2).to(0)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
g5_authenticatable-1.1.4 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.4.rc.3 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.4.rc.2 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.4.rc.1 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.2 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.2.pre.1 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.2.rc.5 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.2.rc.4 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.2.rc.3 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.2.rc.2 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.2.rc.1 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.1 spec/tasks/purge_users_spec.rb
g5_authenticatable-1.1.0 spec/tasks/purge_users_spec.rb