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
Kirill Smelkov
jio
Commits
4132676c
Commit
4132676c
authored
Nov 10, 2017
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FBStorage: do not embed a test inside another one
parent
ac07621c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
69 deletions
+70
-69
test/jio.storage/fbstorage.tests.js
test/jio.storage/fbstorage.tests.js
+70
-69
No files found.
test/jio.storage/fbstorage.tests.js
View file @
4132676c
...
...
@@ -18,7 +18,7 @@
// Facebook Storage constructor
/////////////////////////////////////////////////////////////////
module
(
"
Facebook
Drive
Storage.constructor
"
);
module
(
"
FacebookStorage.constructor
"
);
test
(
"
create storage
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
...
...
@@ -75,7 +75,7 @@
/////////////////////////////////////////////////////////////////
// Facebook Storage.get
/////////////////////////////////////////////////////////////////
module
(
"
Facebook
Storage.get
"
,
{
module
(
"
FacebookStorage.get
"
,
{
setup
:
function
()
{
this
.
server
=
sinon
.
fakeServer
.
create
();
...
...
@@ -128,7 +128,7 @@
/////////////////////////////////////////////////////////////////
// Facebook Storage.allDocs
/////////////////////////////////////////////////////////////////
module
(
"
Facebook
Storage.allDocs
"
,
{
module
(
"
FacebookStorage.allDocs
"
,
{
setup
:
function
()
{
this
.
server
=
sinon
.
fakeServer
.
create
();
...
...
@@ -544,73 +544,74 @@
.
always
(
function
()
{
start
();
});
});
test
(
"
get all posts with limit
"
,
function
()
{
var
url1
=
'
https://graph.facebook.com/v2.9/sample_user_id/feed?fields
'
+
'
=&limit=5&since=&access_token=
'
+
'
sample_token
'
,
url2
=
'
https://graph.facebook.com/v2.9/sample_user_id/feed?fields
'
+
'
=&limit=5&since=&access_token=
'
+
'
sample_token&__paging_token=sample_paging_token
'
,
body1
=
'
{"data": [{"created_time": "2016", "id": "1",
'
+
'
"message": "Test 1"}, {"created_time": "2016", "id": "2",
'
+
'
"message": "Test 2"}, {"created_time": "2016", "id": "3",
'
+
'
"message": "Test 3"}, {"created_time": "2016", "id": "4",
'
+
'
"message": "Test 4"}, {"created_time": "2016", "id": "5",
'
+
'
"message": "Test 5"}, {"created_time": "2016", "id": "6",
'
+
'
"message": "Test 6"}, {"created_time": "2016", "id": "7",
'
+
'
"message": "Test 7"}], "paging": {"next":"
'
+
url2
+
'
",
'
+
'
"previous": null}}
'
,
body2
=
'
{"data": [], "paging": {"next": null, "previous": null}}
'
,
server
=
this
.
server
,
return_object
=
{
"
data
"
:
{
"
rows
"
:
[
{
"
id
"
:
"
3
"
,
"
value
"
:
{}
},
{
"
id
"
:
"
4
"
,
"
value
"
:
{}
},
{
"
id
"
:
"
5
"
,
"
value
"
:
{}
}
],
"
total_rows
"
:
3
}
};
this
.
server
.
respondWith
(
"
GET
"
,
url1
,
[
200
,
{
"
Content-Type
"
:
"
text/xml
"
},
body1
]);
this
.
server
.
respondWith
(
"
GET
"
,
url2
,
[
200
,
{
"
Content-Type
"
:
"
text/xml
"
},
body2
]);
stop
();
expect
(
10
);
test
(
"
get all posts with limit
"
,
function
()
{
var
url1
=
'
https://graph.facebook.com/v2.9/sample_user_id/feed?fields
'
+
'
=&limit=5&since=&access_token=
'
+
'
sample_token
'
,
url2
=
'
https://graph.facebook.com/v2.9/sample_user_id/feed?fields
'
+
'
=&limit=5&since=&access_token=
'
+
'
sample_token&__paging_token=sample_paging_token
'
,
body1
=
'
{"data": [{"created_time": "2016", "id": "1",
'
+
'
"message": "Test 1"}, {"created_time": "2016", "id": "2",
'
+
'
"message": "Test 2"}, {"created_time": "2016", "id": "3",
'
+
'
"message": "Test 3"}, {"created_time": "2016", "id": "4",
'
+
'
"message": "Test 4"}, {"created_time": "2016", "id": "5",
'
+
'
"message": "Test 5"}, {"created_time": "2016", "id": "6",
'
+
'
"message": "Test 6"}, {"created_time": "2016", "id": "7",
'
+
'
"message": "Test 7"}], "paging": {"next":"
'
+
url2
+
'
",
'
+
'
"previous": null}}
'
,
body2
=
'
{"data": [], "paging": {"next": null, "previous": null}}
'
,
server
=
this
.
server
,
return_object
=
{
"
data
"
:
{
"
rows
"
:
[
{
"
id
"
:
"
3
"
,
"
value
"
:
{}
},
{
"
id
"
:
"
4
"
,
"
value
"
:
{}
},
{
"
id
"
:
"
5
"
,
"
value
"
:
{}
}
],
"
total_rows
"
:
3
}
};
this
.
server
.
respondWith
(
"
GET
"
,
url1
,
[
200
,
{
"
Content-Type
"
:
"
text/xml
"
},
body1
]);
this
.
server
.
respondWith
(
"
GET
"
,
url2
,
[
200
,
{
"
Content-Type
"
:
"
text/xml
"
},
body2
]);
stop
();
expect
(
10
);
this
.
jio
.
allDocs
({
'
limit
'
:
[
2
,
5
]})
.
then
(
function
(
result
)
{
equal
(
server
.
requests
.
length
,
2
);
equal
(
server
.
requests
[
0
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
1
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
0
].
url
,
url1
);
equal
(
server
.
requests
[
1
].
url
,
url2
);
equal
(
server
.
requests
[
0
].
status
,
200
);
equal
(
server
.
requests
[
1
].
status
,
200
);
equal
(
server
.
requests
[
0
].
responseText
,
body1
);
equal
(
server
.
requests
[
1
].
responseText
,
body2
);
deepEqual
(
result
,
return_object
);
})
.
fail
(
function
(
error
)
{
ok
(
false
,
error
);
})
.
always
(
function
()
{
start
();
});
});
this
.
jio
.
allDocs
({
'
limit
'
:
[
2
,
5
]})
.
then
(
function
(
result
)
{
equal
(
server
.
requests
.
length
,
2
);
equal
(
server
.
requests
[
0
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
1
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
0
].
url
,
url1
);
equal
(
server
.
requests
[
1
].
url
,
url2
);
equal
(
server
.
requests
[
0
].
status
,
200
);
equal
(
server
.
requests
[
1
].
status
,
200
);
equal
(
server
.
requests
[
0
].
responseText
,
body1
);
equal
(
server
.
requests
[
1
].
responseText
,
body2
);
deepEqual
(
result
,
return_object
);
})
.
fail
(
function
(
error
)
{
ok
(
false
,
error
);
})
.
always
(
function
()
{
start
();
});
});
}(
jIO
,
QUnit
,
sinon
));
\ No newline at end of file
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