rename factory_girl_(rails) to factory_bot_(rails)

This commit is contained in:
Ralf Teusner
2017-11-15 15:18:07 +01:00
parent 951b71780c
commit 0e26ab98c8
68 changed files with 253 additions and 253 deletions

View File

@ -9,12 +9,12 @@ describe InternalUser do
end
it 'validates the uniqueness of the email address' do
user.update(email: FactoryGirl.create(:admin).email)
user.update(email: FactoryBot.create(:admin).email)
expect(user.errors[:email]).to be_present
end
context 'when not activated' do
let(:user) { FactoryGirl.create(:teacher) }
let(:user) { FactoryBot.create(:teacher) }
before(:each) do
user.send(:setup_activation)
@ -33,7 +33,7 @@ describe InternalUser do
end
context 'with a pending password reset' do
let(:user) { FactoryGirl.create(:teacher) }
let(:user) { FactoryBot.create(:teacher) }
before(:each) { user.deliver_reset_password_instructions! }
it 'validates the confirmation of the password' do
@ -48,7 +48,7 @@ describe InternalUser do
end
context 'when complete' do
let(:user) { FactoryGirl.create(:teacher, activation_state: 'active') }
let(:user) { FactoryBot.create(:teacher, activation_state: 'active') }
it 'does not validate the confirmation of the password' do
user.update(password: password, password_confirmation: '')
@ -71,8 +71,8 @@ describe InternalUser do
describe '#admin?' do
it 'is only true for admins' do
expect(FactoryGirl.build(:admin).admin?).to be true
expect(FactoryGirl.build(:teacher).admin?).to be false
expect(FactoryBot.build(:admin).admin?).to be true
expect(FactoryBot.build(:teacher).admin?).to be false
end
end
@ -90,8 +90,8 @@ describe InternalUser do
describe '#teacher?' do
it 'is only true for teachers' do
expect(FactoryGirl.build(:admin).teacher?).to be false
expect(FactoryGirl.build(:teacher).teacher?).to be true
expect(FactoryBot.build(:admin).teacher?).to be false
expect(FactoryBot.build(:teacher).teacher?).to be true
end
end
end