Ivan - Fix download get
This commit is contained in:
parent
b2ad2c10ef
commit
222dbdea04
|
@ -1,10 +1,15 @@
|
|||
$agent = Mechanize.new
|
||||
|
||||
def plainRequest(path, data = {})
|
||||
def plainRequest(path, data = {}, method = 'POST')
|
||||
uri = 'http://localhost:8080' + path
|
||||
response = $agent.post(uri, data)
|
||||
|
||||
return response
|
||||
if method == 'POST'
|
||||
@response = $agent.post(uri, data)
|
||||
else
|
||||
@response = $agent.get(uri, data)
|
||||
end
|
||||
|
||||
return @response
|
||||
end
|
||||
|
||||
def request(path, data = {})
|
||||
|
|
|
@ -32,7 +32,7 @@ describe 'File Upload and Download' do
|
|||
'csrf_userid' => $csrf_userid,
|
||||
'csrf_token' => $csrf_token,
|
||||
'file' => ticket['file']
|
||||
})
|
||||
}, 'GET')
|
||||
|
||||
(result.body).should.equal(file.read)
|
||||
end
|
||||
|
@ -47,7 +47,7 @@ describe 'File Upload and Download' do
|
|||
'csrf_userid' => $csrf_userid,
|
||||
'csrf_token' => $csrf_token,
|
||||
'file' => ticket['file']
|
||||
})
|
||||
}, 'GET')
|
||||
|
||||
(result.body).should.equal('')
|
||||
end
|
||||
|
@ -66,7 +66,7 @@ describe 'File Upload and Download' do
|
|||
'csrf_userid' => $csrf_userid,
|
||||
'csrf_token' => $csrf_token,
|
||||
'file' => ticket['file']
|
||||
})
|
||||
}, 'GET')
|
||||
|
||||
(result.body).should.equal(file.read)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue