Skip to content

Instantly share code, notes, and snippets.

@gambtho
Created September 8, 2016 15:41
Show Gist options
  • Save gambtho/6be345ea2da7bda0406e85436214a099 to your computer and use it in GitHub Desktop.
Save gambtho/6be345ea2da7bda0406e85436214a099 to your computer and use it in GitHub Desktop.
import {
  generateUser,
} from '../../../../helpers/api-integration/v3';

describe('payments - stripe - #checkout', () => {
  let endpoint = '/stripe/checkout';
  let user;

  beforeEach(async () => {
    user = await generateUser();
  });

  it('verifies credentials', async () => {
    await expect(user.post(endpoint, {id: 123})).to.eventually.be.rejected.and.eql({
      code: 401,
      error: 'Error',
      message: 'Invalid API Key provided: ****************************1111',
    });
  });
});
  1) payments - stripe - #checkout verifies credentials:

      AssertionError: expected { Object (code, error, ...) } to deeply equal { Object (code, error, ...) }
      + expected - actual

       {
      -  "code": 500
      -  "error": "InternalServerError"
      -  "message": "An unexpected error occurred."
      +  "code": 401
      +  "error": "Error"
      +  "message": "Invalid API Key provided: ****************************1111"
       }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment