Fix test for new custom file
This commit is contained in:
@ -6,7 +6,7 @@ module FileParameters
|
||||
params.reject do |_, file_attributes|
|
||||
file = CodeOcean::File.find_by(id: file_attributes[:file_id])
|
||||
# avoid that public files from other contexts can be created
|
||||
file.nil? || file.hidden || file.read_only || file.context == 'Exercise' && file.context_id != exercise.id
|
||||
file.nil? || file.hidden || file.read_only || file.context_type == 'Exercise' && file.context_id != exercise.id
|
||||
end
|
||||
else
|
||||
[]
|
||||
|
@ -24,7 +24,8 @@ describe FileParameters do
|
||||
end
|
||||
|
||||
it 'new file' do
|
||||
new_file = FactoryBot.create(:file, context: hello_world)
|
||||
submission = FactoryBot.create(:submission, exercise: hello_world, id: 1337)
|
||||
new_file = FactoryBot.create(:file, context: submission)
|
||||
expect(file_accepted?(new_file)).to be true
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user