mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
* Remove factory_girl include from dev rake task
No longer needed after 92b125b4a7
* Add missing factories
* Use FactoryBot factories instead of fabricators
* Remove all fabricators
* Remove unused method
* Remove fabrication gem
* Rename FactoryGirl to FactoryBot
https://robots.thoughtbot.com/factory_bot
32 lines
813 B
Ruby
32 lines
813 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe AdminUser do
|
|
context 'with invalid attribute' do
|
|
before do
|
|
@admin_user = described_class.new
|
|
end
|
|
|
|
it 'should not have any versions' do
|
|
@admin_user.versions.should == []
|
|
end
|
|
end
|
|
|
|
context 'with valid attributes' do
|
|
before do
|
|
@admin_user = create(:admin_user)
|
|
end
|
|
|
|
it 'should require password confirmation when changing password' do
|
|
@admin_user.valid?.should == true
|
|
@admin_user.password = 'not confirmed'
|
|
@admin_user.valid?
|
|
@admin_user.errors.full_messages.should match_array(["Password confirmation doesn't match Password"])
|
|
end
|
|
end
|
|
|
|
describe '::min_password_length' do
|
|
it 'returns minimum password length' do
|
|
expect(described_class.min_password_length).to eq(8)
|
|
end
|
|
end
|
|
end
|