Fix Rubocop offense
This commit is contained in:
@ -176,7 +176,7 @@ class ExercisesController < ApplicationController
|
|||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
exercise = ::ProformaService::Import.call(zip: tempfile, user: user)
|
exercise = ::ProformaService::Import.call(zip: tempfile, user: user)
|
||||||
exercise.save!
|
exercise.save!
|
||||||
return render json: {}, status: :created
|
render json: {}, status: :created
|
||||||
end
|
end
|
||||||
rescue Proforma::ExerciseNotOwned
|
rescue Proforma::ExerciseNotOwned
|
||||||
render json: {}, status: :unauthorized
|
render json: {}, status: :unauthorized
|
||||||
|
@ -23,7 +23,7 @@ Rails.application.eager_load!
|
|||||||
(ApplicationRecord.descendants - [ActiveRecord::SchemaMigration, User]).each(&:delete_all)
|
(ApplicationRecord.descendants - [ActiveRecord::SchemaMigration, User]).each(&:delete_all)
|
||||||
|
|
||||||
# delete file uploads
|
# delete file uploads
|
||||||
FileUtils.rm_rf(Rails.root.join('public/uploads'))
|
FileUtils.rm_rf(Rails.public_path.join('uploads'))
|
||||||
|
|
||||||
# load environment-dependent seeds
|
# load environment-dependent seeds
|
||||||
load(Rails.root.join("db/seeds/#{Rails.env}.rb"))
|
load(Rails.root.join("db/seeds/#{Rails.env}.rb"))
|
||||||
|
@ -11,7 +11,7 @@ describe FileUploader do
|
|||||||
after { uploader.remove! }
|
after { uploader.remove! }
|
||||||
|
|
||||||
it 'uses the specified storage directory' do
|
it 'uses the specified storage directory' do
|
||||||
expect(uploader.file.path).to start_with(Rails.root.join('public', uploader.store_dir).to_s)
|
expect(uploader.file.path).to start_with(Rails.public_path.join(uploader.store_dir).to_s)
|
||||||
expect(uploader.file.path).to end_with(file_path.basename.to_s)
|
expect(uploader.file.path).to end_with(file_path.basename.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user