-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for the File Link resource
- Loading branch information
1 parent
3f1efd7
commit 4d95bf6
Showing
3 changed files
with
81 additions
and
15 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 @@ | ||
'use strict'; | ||
|
||
var StripeResource = require('../StripeResource'); | ||
|
||
module.exports = StripeResource.extend({ | ||
|
||
path: 'file_links', | ||
includeBasic: [ | ||
'create', 'list', 'retrieve', 'update', 'setMetadata', 'getMetadata', | ||
], | ||
}); |
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,54 @@ | ||
'use strict'; | ||
|
||
var stripe = require('../testUtils').getSpyableStripe(); | ||
var expect = require('chai').expect; | ||
|
||
describe('FileLinks Resource', function() { | ||
describe('retrieve', function() { | ||
it('Sends the correct request', function() { | ||
stripe.fileLinks.retrieve('fl_123'); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'GET', | ||
url: '/v1/file_links/fl_123', | ||
headers: {}, | ||
data: {}, | ||
}); | ||
}); | ||
}); | ||
|
||
describe('create', function() { | ||
it('Sends the correct request', function() { | ||
stripe.fileLinks.create({file: 'file_123'}); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'POST', | ||
url: '/v1/file_links', | ||
headers: {}, | ||
data: {file: 'file_123'}, | ||
}); | ||
}); | ||
}); | ||
|
||
describe('update', function() { | ||
it('Sends the correct request', function() { | ||
stripe.fileLinks.update('fl_123', {metadata: {key: 'value'}}); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'POST', | ||
url: '/v1/file_links/fl_123', | ||
headers: {}, | ||
data: {metadata: {key: 'value'}}, | ||
}); | ||
}); | ||
}); | ||
|
||
describe('list', function() { | ||
it('Sends the correct request', function() { | ||
stripe.fileLinks.list(); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'GET', | ||
url: '/v1/file_links', | ||
headers: {}, | ||
data: {}, | ||
}); | ||
}); | ||
}); | ||
}); |