mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-28 08:14:25 +02:00
Ivan - Fix download get
This commit is contained in:
parent
b2ad2c10ef
commit
222dbdea04
@ -1,10 +1,15 @@
|
|||||||
$agent = Mechanize.new
|
$agent = Mechanize.new
|
||||||
|
|
||||||
def plainRequest(path, data = {})
|
def plainRequest(path, data = {}, method = 'POST')
|
||||||
uri = 'http://localhost:8080' + path
|
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
|
end
|
||||||
|
|
||||||
def request(path, data = {})
|
def request(path, data = {})
|
||||||
|
@ -32,7 +32,7 @@ describe 'File Upload and Download' do
|
|||||||
'csrf_userid' => $csrf_userid,
|
'csrf_userid' => $csrf_userid,
|
||||||
'csrf_token' => $csrf_token,
|
'csrf_token' => $csrf_token,
|
||||||
'file' => ticket['file']
|
'file' => ticket['file']
|
||||||
})
|
}, 'GET')
|
||||||
|
|
||||||
(result.body).should.equal(file.read)
|
(result.body).should.equal(file.read)
|
||||||
end
|
end
|
||||||
@ -47,7 +47,7 @@ describe 'File Upload and Download' do
|
|||||||
'csrf_userid' => $csrf_userid,
|
'csrf_userid' => $csrf_userid,
|
||||||
'csrf_token' => $csrf_token,
|
'csrf_token' => $csrf_token,
|
||||||
'file' => ticket['file']
|
'file' => ticket['file']
|
||||||
})
|
}, 'GET')
|
||||||
|
|
||||||
(result.body).should.equal('')
|
(result.body).should.equal('')
|
||||||
end
|
end
|
||||||
@ -66,7 +66,7 @@ describe 'File Upload and Download' do
|
|||||||
'csrf_userid' => $csrf_userid,
|
'csrf_userid' => $csrf_userid,
|
||||||
'csrf_token' => $csrf_token,
|
'csrf_token' => $csrf_token,
|
||||||
'file' => ticket['file']
|
'file' => ticket['file']
|
||||||
})
|
}, 'GET')
|
||||||
|
|
||||||
(result.body).should.equal(file.read)
|
(result.body).should.equal(file.read)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user