Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
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
Hamza
jio
Commits
42a5a033
Commit
42a5a033
authored
Oct 11, 2017
by
Vincent Bechu
Committed by
Vincent Bechu
Oct 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[querystorage] Fail on wrong schema
parent
7f71dd30
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
src/jio.storage/querystorage.js
src/jio.storage/querystorage.js
+5
-0
test/jio.storage/querystorage.tests.js
test/jio.storage/querystorage.tests.js
+22
-1
No files found.
src/jio.storage/querystorage.js
View file @
42a5a033
...
@@ -20,6 +20,11 @@
...
@@ -20,6 +20,11 @@
if
(
storage
.
_key_schema
.
cast_lookup
.
dateType
===
undefined
)
{
if
(
storage
.
_key_schema
.
cast_lookup
.
dateType
===
undefined
)
{
storage
.
_key_schema
.
cast_lookup
.
dateType
=
dateType
;
storage
.
_key_schema
.
cast_lookup
.
dateType
=
dateType
;
}
}
}
else
{
throw
new
jIO
.
util
.
jIOError
(
"
Wrong schema for property:
"
+
property
,
400
);
}
}
}
}
}
}
...
...
test/jio.storage/querystorage.tests.js
View file @
42a5a033
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
// queryStorage.constructor
// queryStorage.constructor
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
queryStorage.constructor
"
);
module
(
"
queryStorage.constructor
"
);
test
(
"
create substorage
"
,
function
()
{
test
(
"
accept parameters
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
var
jio
=
jIO
.
createJIO
({
type
:
"
query
"
,
type
:
"
query
"
,
schema
:
{
'
date
'
:
{
type
:
'
string
'
,
format
:
'
date-time
'
}},
schema
:
{
'
date
'
:
{
type
:
'
string
'
,
format
:
'
date-time
'
}},
...
@@ -45,6 +45,27 @@
...
@@ -45,6 +45,27 @@
});
});
test
(
"
failed on wrond schema
"
,
function
()
{
throws
(
function
()
{
jIO
.
createJIO
({
type
:
"
query
"
,
schema
:
{
'
date
'
:
{
type
:
'
couscous
'
}},
sub_storage
:
{
type
:
"
querystorage200
"
}
});
},
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
status_code
,
400
);
equal
(
error
.
message
,
"
Wrong schema for property: date
"
);
return
true
;
}
);
});
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// queryStorage.get
// queryStorage.get
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
...
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