rename factory_girl_(rails) to factory_bot_(rails)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user