rename factory_girl_(rails) to factory_bot_(rails)
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
require 'rails_helper'
|
||||
|
||||
describe 'Authentication' do
|
||||
let(:user) { FactoryGirl.create(:admin) }
|
||||
let(:password) { FactoryGirl.attributes_for(:admin)[:password] }
|
||||
let(:user) { FactoryBot.create(:admin) }
|
||||
let(:password) { FactoryBot.attributes_for(:admin)[:password] }
|
||||
|
||||
context 'when signed out' do
|
||||
before(:each) { visit(root_path) }
|
||||
|
@ -2,7 +2,7 @@ require 'rails_helper'
|
||||
|
||||
describe 'Authorization' do
|
||||
context 'as an admin' do
|
||||
let(:user) { FactoryGirl.create(:admin) }
|
||||
let(:user) { FactoryBot.create(:admin) }
|
||||
before(:each) { allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user) }
|
||||
|
||||
[Consumer, ExecutionEnvironment, Exercise, FileType, InternalUser].each do |model|
|
||||
@ -11,7 +11,7 @@ describe 'Authorization' do
|
||||
end
|
||||
|
||||
context 'as an external user' do
|
||||
let(:user) { FactoryGirl.create(:external_user) }
|
||||
let(:user) { FactoryBot.create(:external_user) }
|
||||
before(:each) { allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user) }
|
||||
|
||||
[Consumer, ExecutionEnvironment, Exercise, FileType, InternalUser].each do |model|
|
||||
@ -20,7 +20,7 @@ describe 'Authorization' do
|
||||
end
|
||||
|
||||
context 'as a teacher' do
|
||||
let(:user) { FactoryGirl.create(:teacher) }
|
||||
let(:user) { FactoryBot.create(:teacher) }
|
||||
before(:each) { allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user) }
|
||||
|
||||
[Consumer, InternalUser].each do |model|
|
||||
|
@ -1,13 +1,13 @@
|
||||
require 'rails_helper'
|
||||
|
||||
describe 'Editor', js: true do
|
||||
let(:exercise) { FactoryGirl.create(:audio_video, instructions: Forgery(:lorem_ipsum).sentence) }
|
||||
let(:user) { FactoryGirl.create(:teacher) }
|
||||
let(:exercise) { FactoryBot.create(:audio_video, instructions: Forgery(:lorem_ipsum).sentence) }
|
||||
let(:user) { FactoryBot.create(:teacher) }
|
||||
|
||||
before(:each) do
|
||||
visit(sign_in_path)
|
||||
fill_in('email', with: user.email)
|
||||
fill_in('password', with: FactoryGirl.attributes_for(:teacher)[:password])
|
||||
fill_in('password', with: FactoryBot.attributes_for(:teacher)[:password])
|
||||
click_button(I18n.t('sessions.new.link'))
|
||||
visit(implement_exercise_path(exercise))
|
||||
end
|
||||
|
@ -2,6 +2,6 @@ require 'rails_helper'
|
||||
|
||||
describe 'Factories' do
|
||||
it 'are all valid', docker: true, permitted_execution_time: 30 do
|
||||
expect { FactoryGirl.lint }.not_to raise_error
|
||||
expect { FactoryBot.lint }.not_to raise_error
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user