Commit 60666317 authored by Antonio Terceiro's avatar Antonio Terceiro

Merge branch 'self-service-upload-patch' into 'master'

self_service: check empty file when test by upload

See merge request !100
parents cc5fe0ae 9fd9b7b0
Pipeline #60550 passed with stage
in 10 minutes and 57 seconds
......@@ -78,6 +78,7 @@ module Debci
post '/test/upload' do
begin
raise "Please select a JSON file to upload" if params[:tests].nil?
test_requests = JSON.parse(File.read(params[:tests][:tempfile]))
validate_json_submission(test_requests)
......
......@@ -106,6 +106,13 @@ describe Debci::SelfService do
expect(job.suite).to eq(suite)
end
it 'should return error with no file selected for uplaod' do
job_count = Debci::Job.count
post '/selfservice/test/upload', {}, 'SSL_CLIENT_S_DN_CN' => 'foo@bar.com'
expect(last_response.status).to eq(400)
expect(Debci::Job.count).to eq(job_count)
end
it 'should return error with an invalid suite' do
test_json = [
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment