Skip to content

Commit

Permalink
🔧 Fix tests and examples link.
Browse files Browse the repository at this point in the history
  • Loading branch information
psbrandt committed Apr 6, 2016
1 parent 8dc089e commit b9c2d34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ OpenMRS API in node or the browser.
## Install

```sh
npm install openmrs.js@alpha
npm install openmrs.js
```

## Setup
Expand Down Expand Up @@ -78,7 +78,7 @@ operations for the 'patient' tag
* createPatient: Create with properties in request
```

See the [examples](docs/examples) for further demonstrations.
See the [examples](examples) for further demonstrations.

## API Documentation

Expand Down
2 changes: 1 addition & 1 deletion src/openmrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class OpenMRS {
let specUrl = url;

// make sure a protocol is specified
if (url.substring(0, 3) !== constants.OMRSJS_DEFAULT_PROTOCOL) {
if (url.substring(0, 4) !== constants.OMRSJS_DEFAULT_PROTOCOL) {
specUrl = `${constants.OMRSJS_DEFAULT_PROTOCOL}://${specUrl}`;
}

Expand Down
4 changes: 4 additions & 0 deletions test/openmrs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ describe('Contructing a new instance of OpenMRS with the base URL and protocol',

it('should succeed with just the user and password', () => {
fauxJax.on('request', (req) => {
expect(req.requestURL).to.be.equal('http://localhost:8080/openmrs/module/webservices/rest/swagger.json');
req.respond(200, {
'Content-Type': 'application/json',
}, JSON.stringify(swaggerSpec));
Expand Down Expand Up @@ -169,6 +170,7 @@ describe('Contructing a new instance of OpenMRS with the full URL without protoc

it('should succeed with just the user and password', () => {
fauxJax.on('request', (req) => {
expect(req.requestURL).to.be.equal('http://localhost:8080/openmrs/module/webservices/rest/swagger.json');
req.respond(200, {
'Content-Type': 'application/json',
}, JSON.stringify(swaggerSpec));
Expand Down Expand Up @@ -197,6 +199,7 @@ describe('Contructing a new instance of OpenMRS with the base URL without protoc

it('should succeed with just the user and password', () => {
fauxJax.on('request', (req) => {
expect(req.requestURL).to.be.equal('http://localhost:8080/openmrs/module/webservices/rest/swagger.json');
req.respond(200, {
'Content-Type': 'application/json',
}, JSON.stringify(swaggerSpec));
Expand Down Expand Up @@ -231,6 +234,7 @@ describe('Contructing a new instance of OpenMRS with the config object', () => {

it('should succeed with no parameters', () => {
fauxJax.on('request', (req) => {
expect(req.requestURL).to.be.equal('http://localhost:8080/openmrs/module/webservices/rest/swagger.json');
req.respond(200, {
'Content-Type': 'application/json',
}, JSON.stringify(swaggerSpec));
Expand Down

0 comments on commit b9c2d34

Please sign in to comment.