Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('PUT update existing security answer is forbidden via public API even when authenticated', () => {
return frisby.put(API_URL + '/SecurityAnswers/1', {
headers: authHeader,
body: {
answer: 'Blurp'
}
})
.expect('status', 401)
})
it('PUT update existing feedback', () => {
return frisby.put(API_URL + '/Feedbacks/2', {
headers: authHeader,
body: {
rating: 0
}
})
.expect('status', 401)
})
it('PUT update existing user is forbidden via API even when authenticated', () => {
return frisby.put(API_URL + '/Users/1', {
headers: authHeader,
body: { email: 'horst.horstmann@horstma.nn' }
})
.expect('status', 401)
})
it('PUT invalid continue code is rejected', function (done) {
frisby.put(REST_URL + '/continue-code/apply/ThisIsDefinitelyNotAValidContinueCode')
.expect('status', 404)
.done(done)
})
it('PUT single product review can be created', () => {
return frisby.put(REST_URL + '/products/1/reviews', {
body: {
message: 'Lorem Ipsum',
author: 'Anonymous'
}
})
.expect('status', 201)
.expect('header', 'content-type', /application\/json/)
})
})
it('PUT update address is forbidden via public API', () => {
return frisby.put(API_URL + '/Addresss/1', {
quantity: 2
}, { json: true })
.expect('status', 401)
})
it('PUT update existing complaint is forbidden', function (done) {
frisby.put(API_URL + '/Complaints/1', {
headers: authHeader,
body: {
message: 'Should not work...'
}
})
.expect('status', 401)
.done(done)
})
it('PUT update existing complaint is forbidden', () => {
return frisby.put(API_URL + '/Complaints/1', {
headers: authHeader,
body: {
message: 'Should not work...'
}
})
.expect('status', 401)
})
.then(({ json }) => {
return frisby.put(API_URL + '/Quantitys/1', {
headers: { Authorization: 'Bearer ' + json.authentication.token, 'content-type': 'application/json' },
body: {
quantity: 100
}
})
.expect('status', 403)
.expect('json', 'error', 'Malicious activity detected')
})
})
it("HTTP method not supported", function(doneFn) {
frisby.put(baseUrl + '/equation', {
mathType : 'AsciiMath',
math : 'a^2+b^2=c^2',
description : 'true',
svg : 'true'
})
.expect('status', 404)
.done(doneFn);
});