How to use the frisby.put function in frisby

To help you get started, we’ve selected a few frisby examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bkimminich / juice-shop / test / api / securityAnswerApiSpec.js View on Github external
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)
  })
github bkimminich / juice-shop / test / api / feedbackApiSpec.js View on Github external
it('PUT update existing feedback', () => {
    return frisby.put(API_URL + '/Feedbacks/2', {
      headers: authHeader,
      body: {
        rating: 0
      }
    })
      .expect('status', 401)
  })
github bkimminich / juice-shop / test / api / userApiSpec.js View on Github external
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)
  })
github bkimminich / juice-shop / test / api / challengeApiSpec.js View on Github external
it('PUT invalid continue code is rejected', function (done) {
    frisby.put(REST_URL + '/continue-code/apply/ThisIsDefinitelyNotAValidContinueCode')
      .expect('status', 404)
      .done(done)
  })
github bkimminich / juice-shop / test / api / productReviewApiSpec.js View on Github external
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/)
  })
})
github bkimminich / juice-shop / test / api / addressApiSpec.js View on Github external
it('PUT update address is forbidden via public API', () => {
    return frisby.put(API_URL + '/Addresss/1', {
      quantity: 2
    }, { json: true })
      .expect('status', 401)
  })
github bkimminich / juice-shop / test / api / complaintApiSpec.js View on Github external
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)
  })
github bkimminich / juice-shop / test / api / complaintApiSpec.js View on Github external
it('PUT update existing complaint is forbidden', () => {
    return frisby.put(API_URL + '/Complaints/1', {
      headers: authHeader,
      body: {
        message: 'Should not work...'
      }
    })
      .expect('status', 401)
  })
github bkimminich / juice-shop / test / api / quantityApiSpec.js View on Github external
.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')
      })
  })
github benetech / mmlc-api / spec / error_response_spec.js View on Github external
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);
    });

frisby

Frisby.js v2.0: REST API Endpoint Testing built on Jasmine

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis