Sha256: 36a51b829c239bd921a88e8b4fba040755a6f710b81123ae3dbc434c406a5a13

Contents?: true

Size: 980 Bytes

Versions: 18

Compression:

Stored size: 980 Bytes

Contents

require 'spec_helper'

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) { FactoryGirl.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) { FactoryGirl.create(:g5_authenticatable_user) }
    let!(:user2) { FactoryGirl.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

18 entries across 18 versions & 1 rubygems

Version Path
g5_authenticatable-0.9.1.pre.2 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.8.1.pre spec/tasks/purge_users_spec.rb
g5_authenticatable-0.8.0 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.8.0.beta1 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.7.5 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.7.5.beta spec/tasks/purge_users_spec.rb
g5_authenticatable-0.7.4 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.7.4.beta.1 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.7.3 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.7.2 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.7.1 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.7.0 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.6.0 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.5.1 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.5.0 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.4.2 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.4.1 spec/tasks/purge_users_spec.rb
g5_authenticatable-0.4.0 spec/tasks/purge_users_spec.rb