-
Notifications
You must be signed in to change notification settings - Fork 29
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 #23 from javaguirre/json-result-format
Json result format Added tests and travis-ci configuration
- Loading branch information
Showing
3 changed files
with
61 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: objective-c | ||
|
||
notifications: | ||
email: | ||
on_success: never | ||
on_failure: change | ||
|
||
script: 'curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh' | ||
|
||
git: | ||
depth: 10 |
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 @@ | ||
RestClientView = require '../lib/rest-client-view' | ||
|
||
describe "RestClientView test", -> | ||
[restClient] = [] | ||
|
||
beforeEach -> | ||
restClient = new RestClientView() | ||
|
||
describe "View", -> | ||
it "the view is loaded", -> | ||
expect(restClient.find('.rest-client-send')).toExist() | ||
|
||
describe "Json", -> | ||
it "body is not json", -> | ||
expect(restClient.isJson("<html></html>")).toBe(false) | ||
|
||
it "body is json", -> | ||
expect(restClient.isJson('{"hello": "world"}')).toBe(true) | ||
|
||
it "process result is not json", -> | ||
expect(restClient.processResult('<html></html>')).toEqual('<html></html>') | ||
|
||
it "process result is json", -> | ||
expect(restClient.processResult('{"hello": "world"}')).toEqual('{\n "hello": "world"\n}') |