Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Update resources regarding save() and delete() #567

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update FactorInstantiator
  • Loading branch information
Luka Skukan committed Nov 14, 2016
commit a020fd3b1165ad13307aa27a7c92079d5b392290
8 changes: 4 additions & 4 deletions lib/resource/FactorInstantiator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var utils = require('../utils');
var Factor = require('./Factor');
var SmsFactor = require('./SmsFactor');
var GoogleAuthenticatorFactor = require('./GoogleAuthenticatorFactor');
var InstanceResource = require('./InstanceResource');
var Resource = require('./Resource');

/**
* Retrieves the constructor for a correct {@link Factor} instance ({@link SmsFactor} or
Expand Down Expand Up @@ -45,10 +45,10 @@ function getFactorConstructor(/* factor */) {
* The constructor for {@link Factor} instances ({@link SmsFactor} or
* {@link GoogleAuthenticatorFactor}). It parses the data to construct the
* correct constructor, and calls it with the data. It is used for polymorphic
* factor instantiation. It augments {@link InstanceResource} to adhere to the
* factor instantiation. It augments {@link Resource} to adhere to the
* interface used for instantiation in {@link ResourceFactory}.
*
* @augments InstanceResource
* @augments Resource
*/
function FactorInstantiator() {
var Ctor = getFactorConstructor.apply(this, arguments);
Expand All @@ -62,7 +62,7 @@ function FactorInstantiator() {
return new (Ctor.bind.apply(Ctor, argsWithContext))();
}

utils.inherits(FactorInstantiator, InstanceResource);
utils.inherits(FactorInstantiator, Resource);

module.exports = {
Constructor: FactorInstantiator,
Expand Down
6 changes: 3 additions & 3 deletions test/sp.resource.factorInstantiator_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var common = require('./common');
var assert = common.assert;
var sinon = common.sinon;

var InstanceResource = require('../lib/resource/InstanceResource');
var Resource = require('../lib/resource/Resource');
var FactorInstantiator = require('../lib/resource/FactorInstantiator');
var FactorConstructor = FactorInstantiator.Constructor;
var Factor = require('../lib/resource/Factor');
Expand All @@ -22,8 +22,8 @@ describe('FactorInstantiator#Constructor', function() {
sandbox.restore();
});

it('should inherit from InstanceResource', function() {
assert.equal(FactorConstructor.super_, InstanceResource);
it('should inherit from Resource', function() {
assert.equal(FactorConstructor.super_, Resource);
});

it('should construct an SmsFactor if type is SMS', function() {
Expand Down