-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from nepalcodes/endpoints_branch
init commit
- Loading branch information
Showing
6 changed files
with
18,210 additions
and
7,391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
describe('organizations', () =>{ | ||
Cypress.config('baseUrl','http://localhost/api') | ||
|
||
it('Get- read', () => { | ||
cy.request('/events').then((response) => { | ||
expect(response).to.have.property('status',200) | ||
expect(response.body).to.not.be.null | ||
}) | ||
}) | ||
|
||
it('POST-Create', () => { | ||
const item = {"success":1,"timestamp":"2020-03-25 16:52:19","results":{"0":{"event":"Teej","Location":"Hindu Sabha Mandir","Date":"9/01","Price":"$39"},"1":{"event":"Dashain","Location":"My House","Date":"6/20","Price":"$62"}}} | ||
cy.request('events?id=0',item ) | ||
.its('body') | ||
.its('results') | ||
.should('include',{event:'Teej'}) | ||
}) | ||
|
||
it('PUT - Update', () => { | ||
const item = {"event":"Holi"} | ||
cy.request({method:'PUT',url:'events?id=0',body:item, failOnStatusCode: false}) | ||
|
||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
describe('organizations', () =>{ | ||
Cypress.config('baseUrl','http://localhost/api/') | ||
|
||
it('GET - read', () => { | ||
cy.request('/organizations').then((response) => { | ||
expect(response).to.have.property('status',200) | ||
expect(response.body).to.not.be.null | ||
}) | ||
}) | ||
|
||
it('POST-Create', () => { | ||
const item = {"success":1,"timestamp":"2020-03-25 15:38:30","results":{"0":{"Name":"Nandu Business","Net Worth":"6 Billion","Business Type":"Real Estate Dealer"},"1":{"Name":"Sailesh Business","Net Worth":"20 Billion","Business Type":"Food Dealer"}}} | ||
cy.request('organizations?id=0',item ) | ||
.its('body') | ||
.its('results') | ||
.should('include',{Name:'Nandu Business'}) | ||
}) | ||
|
||
it('PUT - update', () => { | ||
const item = {"Name":"Saagr"} | ||
cy.request({method:'PUT', url:'/organizations?',body:item, failOnStatusCode: false}) | ||
}) | ||
}) |
Oops, something went wrong.