Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio_mebibou
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alexandra Rogova
jio_mebibou
Commits
dd1215ea
Commit
dd1215ea
authored
Aug 26, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JIO job deny + Job condition addition tests added
parent
cebe0585
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
test/jio/tests.js
test/jio/tests.js
+36
-0
No files found.
test/jio/tests.js
View file @
dd1215ea
...
@@ -953,4 +953,40 @@
...
@@ -953,4 +953,40 @@
});
});
test
(
'
Job Deny + Job condition addition
'
,
function
()
{
expect
(
1
);
var
clock
,
jio
;
clock
=
sinon
.
useFakeTimers
();
jIO
.
addJobRuleCondition
(
'
isGetMethod
'
,
function
(
job
)
{
return
job
.
method
===
'
get
'
;
});
jio
=
new
JIO
({
"
type
"
:
"
fake
"
,
"
id
"
:
"
Job Wait
"
},
{
"
workspace
"
:
{},
"
job_rules
"
:
[{
"
code_name
"
:
"
get rejecter
"
,
"
single
"
:
true
,
"
action
"
:
"
deny
"
,
"
conditions
"
:
[
"
isGetMethod
"
]
}]
});
jio
.
get
({
"
_id
"
:
"
a
"
}).
always
(
function
(
answer
)
{
deepEqual
(
answer
,
{
"
error
"
:
"
precondition_failed
"
,
"
message
"
:
"
Command rejected by the job checker.
"
,
"
reason
"
:
"
command denied
"
,
"
status
"
:
412
,
"
statusText
"
:
"
Precondition Failed
"
},
"
Get respond
"
);
});
clock
.
tick
(
1
);
});
}));
}));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment