Ivan - Fix download get

This commit is contained in:
ivan 2017-02-15 03:08:48 -03:00
parent b2ad2c10ef
commit 222dbdea04
2 changed files with 11 additions and 6 deletions

View File

@ -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 = {})

View File

@ -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