forked from moul/node-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApiBaseHTTP.test.coffee
More file actions
33 lines (25 loc) · 908 Bytes
/
ApiBaseHTTP.test.coffee
File metadata and controls
33 lines (25 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
chai = require 'chai'
expect = chai.expect
sinon = require 'sinon'
proxyquire = require 'proxyquire'
sinonChai = require 'sinon-chai'
chai.use sinonChai
describe "ApiBaseHTTP", ->
ApiBaseHTTP = null
apibasehttp = null
before ->
ApiBaseHTTP = require('../lib/ApiBaseHTTP').ApiBaseHTTP
beforeEach ->
describe "handleOptions()", ->
it "should strip /api/v3 from `url` parameter if provided", ->
apibasehttp = new ApiBaseHTTP
base_url: "api/v3"
url: "http://gitlab.mydomain.com/api/v3"
token: "test"
expect(apibasehttp.options.url).to.equal("http://gitlab.mydomain.com")
it "should not strip /api/v3 from `url` parameter if not provided", ->
apibasehttp = new ApiBaseHTTP
base_url: "api/v3"
url: "http://gitlab.mydomain.com"
token: "test"
expect(apibasehttp.options.url).to.equal("http://gitlab.mydomain.com")