Fix method setup in authorization-scopes.test
Fix the code builing a scoped method to correctly handle the case when the setup method is called twice and the previously defined method has to be overriden with new remoting metadata.
This commit is contained in:
parent
9c63abef52
commit
d95ec66a23
|
@ -82,6 +82,10 @@ describe('Authorization scopes', () => {
|
|||
}
|
||||
|
||||
function givenRemoteMethodWithCustomScope() {
|
||||
// Delete any previosly registered instance of the method "scoped"
|
||||
User.sharedClass._methods = User.sharedClass._methods
|
||||
.filter(m => m.name !== 'scoped');
|
||||
|
||||
const accessScopes = arguments[0] || [CUSTOM_SCOPE];
|
||||
User.scoped = function(cb) { cb(); };
|
||||
User.remoteMethod('scoped', {
|
||||
|
|
Loading…
Reference in New Issue