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

@ -1,14 +1,14 @@
require 'rails_helper'
describe CodeOcean::FilesController do
let(:user) { FactoryGirl.create(:admin) }
let(:user) { FactoryBot.create(:admin) }
before(:each) { allow(controller).to receive(:current_user).and_return(user) }
describe 'POST #create' do
let(:submission) { FactoryGirl.create(:submission, user: user) }
let(:submission) { FactoryBot.create(:submission, user: user) }
context 'with a valid file' do
let(:request) { proc { post :create, code_ocean_file: FactoryGirl.build(:file, context: submission).attributes, format: :json } }
let(:request) { proc { post :create, code_ocean_file: FactoryBot.build(:file, context: submission).attributes, format: :json } }
before(:each) { request.call }
expect_assigns(file: CodeOcean::File)
@ -31,14 +31,14 @@ describe CodeOcean::FilesController do
end
describe 'DELETE #destroy' do
let(:exercise) { FactoryGirl.create(:fibonacci) }
let(:exercise) { FactoryBot.create(:fibonacci) }
let(:request) { proc { delete :destroy, id: exercise.files.first.id } }
before(:each) { request.call }
expect_assigns(file: CodeOcean::File)
it 'destroys the file' do
FactoryGirl.create(:fibonacci)
FactoryBot.create(:fibonacci)
expect { request.call }.to change(CodeOcean::File, :count).by(-1)
end