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

@ -3,15 +3,15 @@ require 'rails_helper'
describe CodeOcean::FilePolicy do
subject { described_class }
let(:exercise) { FactoryGirl.create(:fibonacci) }
let(:submission) { FactoryGirl.create(:submission) }
let(:exercise) { FactoryBot.create(:fibonacci) }
let(:submission) { FactoryBot.create(:submission) }
permissions :create? do
context 'as part of an exercise' do
let(:file) { exercise.files.first }
it 'grants access to admins' do
expect(subject).to permit(FactoryGirl.build(:admin), file)
expect(subject).to permit(FactoryBot.build(:admin), file)
end
it 'grants access to authors' do
@ -20,7 +20,7 @@ describe CodeOcean::FilePolicy do
it 'does not grant access to all other users' do
[:external_user, :teacher].each do |factory_name|
expect(subject).not_to permit(FactoryGirl.build(factory_name), file)
expect(subject).not_to permit(FactoryBot.build(factory_name), file)
end
end
end
@ -34,7 +34,7 @@ describe CodeOcean::FilePolicy do
it 'does not grant access to all other users' do
[:admin, :external_user, :teacher].each do |factory_name|
expect(subject).not_to permit(FactoryGirl.build(factory_name), file)
expect(subject).not_to permit(FactoryBot.build(factory_name), file)
end
end
end
@ -45,7 +45,7 @@ describe CodeOcean::FilePolicy do
let(:file) { exercise.files.first }
it 'grants access to admins' do
expect(subject).to permit(FactoryGirl.build(:admin), file)
expect(subject).to permit(FactoryBot.build(:admin), file)
end
it 'grants access to authors' do
@ -54,7 +54,7 @@ describe CodeOcean::FilePolicy do
it 'does not grant access to all other users' do
[:external_user, :teacher].each do |factory_name|
expect(subject).not_to permit(FactoryGirl.build(factory_name), file)
expect(subject).not_to permit(FactoryBot.build(factory_name), file)
end
end
end
@ -64,7 +64,7 @@ describe CodeOcean::FilePolicy do
it 'does not grant access to anyone' do
[:admin, :external_user, :teacher].each do |factory_name|
expect(subject).not_to permit(FactoryGirl.build(factory_name), file)
expect(subject).not_to permit(FactoryBot.build(factory_name), file)
end
end
end