Skip to content

Commit

Permalink
made it my way
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrohmann committed Sep 11, 2015
1 parent f1a79a0 commit 031005f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fluxible-plugin-fetchr",
"version": "0.3.7",
"version": "1.0.0",
"description": "A plugin for Fluxible applications to provide an isomorphic interface for RESTful services",
"main": "index.js",
"repository": {
Expand All @@ -14,7 +14,7 @@
},
"dependencies": {
"debug": "^2.0.0",
"fetchr": "^0.5.14"
"fetchr": "[email protected]:mdrohmann/fetchr.git"
},
"devDependencies": {
"chai": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/services/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
update: function update(req, resource, params, config, body, callback) {
callback(null, 'update');
},
'delete': function del(req, resource, params, config, callback) {
'delete': function del(req, resource, params, config, body, callback) {
callback(null, 'delete');
}
};
20 changes: 13 additions & 7 deletions tests/unit/lib/fetchr-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('fetchrPlugin', function () {
});
describe('delete', function () {
it('should call the service\'s delete method', function (done) {
actionContext.service['delete']('test', {}, function (err, result) {
actionContext.service['delete']('test', {}, null, function (err, result) {
expect(result).to.equal('delete');
expect(actionContext.getServiceMeta()).to.be.empty;
done();
Expand Down Expand Up @@ -169,9 +169,12 @@ describe('fetchrPlugin', function () {

expect(actionContext.service.constructGetXhrUri(
'resourceFoo',
{a: 1},
{
query: {a: 1},
paths: ['a', 'b']
},
{cors: true}
)).to.equal('http://example.com/resourceFoo;a=1?device=tablet', 'default construct uri function');
)).to.equal('http://example.com/resourceFoo/a/b?a=1&device=tablet', 'default construct uri function');
});
});

Expand All @@ -188,14 +191,17 @@ describe('fetchrPlugin', function () {

expect(actionContext.service.constructGetXhrUri(
'resourceFoo',
{a: 1}
)).to.equal('custom2/api/resourceFoo;a=1?device=tablet', 'default construct uri function');
{
query: {a: 1},
paths: ['a', 'b'],
}
)).to.equal('custom2/api/resourceFoo/a/b?a=1&device=tablet', 'default construct uri function');

expect(actionContext.service.constructGetXhrUri(
'resourceFoo',
{a: 1},
{ query: {a: 1}},
{
constructGetUri: function () {
constructUri: function () {
return '/customGetUri';
}
}
Expand Down

0 comments on commit 031005f

Please sign in to comment.