Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
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
Tristan Cavelier
jio
Commits
6e54a1e3
Commit
6e54a1e3
authored
Jun 08, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
querystorage.js: hasCapacity shouldn't return True by default
parent
ac34b9ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
src/jio.storage/querystorage.js
src/jio.storage/querystorage.js
+10
-1
test/jio.storage/querystorage.tests.js
test/jio.storage/querystorage.tests.js
+13
-2
No files found.
src/jio.storage/querystorage.js
View file @
6e54a1e3
...
@@ -44,10 +44,19 @@
...
@@ -44,10 +44,19 @@
};
};
QueryStorage
.
prototype
.
hasCapacity
=
function
(
name
)
{
QueryStorage
.
prototype
.
hasCapacity
=
function
(
name
)
{
var
this_storage_capacity_list
=
[
"
limit
"
,
"
include
"
,
"
sort
"
,
"
select
"
,
"
query
"
];
if
(
this_storage_capacity_list
.
indexOf
(
name
)
!==
-
1
)
{
return
true
;
}
if
(
name
===
"
list
"
)
{
if
(
name
===
"
list
"
)
{
return
this
.
_sub_storage
.
hasCapacity
(
name
);
return
this
.
_sub_storage
.
hasCapacity
(
name
);
}
}
return
tru
e
;
return
fals
e
;
};
};
QueryStorage
.
prototype
.
buildQuery
=
function
(
options
)
{
QueryStorage
.
prototype
.
buildQuery
=
function
(
options
)
{
var
substorage
=
this
.
_sub_storage
,
var
substorage
=
this
.
_sub_storage
,
...
...
test/jio.storage/querystorage.tests.js
View file @
6e54a1e3
...
@@ -307,7 +307,7 @@
...
@@ -307,7 +307,7 @@
// queryStorage.hasCapacity
// queryStorage.hasCapacity
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
queryStorage.hasCapacity
"
);
module
(
"
queryStorage.hasCapacity
"
);
test
(
"
hasCapacity is
tru
e by default
"
,
function
()
{
test
(
"
hasCapacity is
fals
e by default
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
var
jio
=
jIO
.
createJIO
({
type
:
"
query
"
,
type
:
"
query
"
,
sub_storage
:
{
sub_storage
:
{
...
@@ -315,7 +315,18 @@
...
@@ -315,7 +315,18 @@
}
}
});
});
equal
(
jio
.
hasCapacity
(
"
foo
"
),
true
);
throws
(
function
()
{
jio
.
hasCapacity
(
"
foo
"
);
},
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
status_code
,
501
);
equal
(
error
.
message
,
"
Capacity 'foo' is not implemented on 'query'
"
);
return
true
;
}
);
});
});
test
(
"
hasCapacity list return substorage value
"
,
function
()
{
test
(
"
hasCapacity list return substorage value
"
,
function
()
{
...
...
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