Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix create mate tests #883

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions examples/v3/e2e/test/consumer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ describe('Pact V3', () => {
before(() =>
provider
.given('is authenticated')
.uponReceiving('a request to create a new mate')
.uponReceiving('a request to create a new mate with JSON data')
.withRequest({
method: 'POST',
path: '/animals',
Expand All @@ -454,7 +454,7 @@ describe('Pact V3', () => {
})
);

it('creates a new mate', () => {
it('creates a new mate with JSON data', () => {
return provider.executeTest((mockserver) => {
return expect(createMateForDates(suitor, () => mockserver.url)).to
.eventually.be.fulfilled;
Expand All @@ -466,7 +466,7 @@ describe('Pact V3', () => {
before(() =>
provider
.given('is authenticated')
.uponReceiving('a request to create a new mate')
.uponReceiving('a request to create a new mate with x-www-form-urlencoded data')
.withRequest({
method: 'POST',
path: '/animals',
Expand All @@ -481,11 +481,15 @@ describe('Pact V3', () => {
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
body: like(suitor),
body: like({
id: 1,
first_name: 'Nanny',
last_name: 'Doe',
})
})
);

it('creates a new mate with application/x-www-form-urlencoded', () => {
it('creates a new mate with application/x-www-form-urlencoded data', () => {
return provider.executeTest((mockserver) => {
return expect(
createMateForDates(
Expand Down Expand Up @@ -541,7 +545,7 @@ describe('Pact V3', () => {
})
);

it('creates a new mate', () => {
it('gets animals in XML format', () => {
return provider.executeTest((mockserver) => {
return expect(getAnimalsAsXML(() => mockserver.url)).to.eventually.be
.fulfilled;
Expand Down