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
Roque
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 @@
...
@@ -18,7 +18,7 @@
// Facebook Storage constructor
// Facebook Storage constructor
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
Facebook
Drive
Storage.constructor
"
);
module
(
"
FacebookStorage.constructor
"
);
test
(
"
create storage
"
,
function
()
{
test
(
"
create storage
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
var
jio
=
jIO
.
createJIO
({
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// Facebook Storage.get
// Facebook Storage.get
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
Facebook
Storage.get
"
,
{
module
(
"
FacebookStorage.get
"
,
{
setup
:
function
()
{
setup
:
function
()
{
this
.
server
=
sinon
.
fakeServer
.
create
();
this
.
server
=
sinon
.
fakeServer
.
create
();
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// Facebook Storage.allDocs
// Facebook Storage.allDocs
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
Facebook
Storage.allDocs
"
,
{
module
(
"
FacebookStorage.allDocs
"
,
{
setup
:
function
()
{
setup
:
function
()
{
this
.
server
=
sinon
.
fakeServer
.
create
();
this
.
server
=
sinon
.
fakeServer
.
create
();
...
@@ -544,73 +544,74 @@
...
@@ -544,73 +544,74 @@
.
always
(
function
()
{
.
always
(
function
()
{
start
();
start
();
});
});
});
test
(
"
get all posts with limit
"
,
function
()
{
test
(
"
get all posts with limit
"
,
function
()
{
var
url1
=
'
https://graph.facebook.com/v2.9/sample_user_id/feed?fields
'
+
var
url1
=
'
https://graph.facebook.com/v2.9/sample_user_id/feed?fields
'
+
'
=&limit=5&since=&access_token=
'
+
'
=&limit=5&since=&access_token=
'
+
'
sample_token
'
,
'
sample_token
'
,
url2
=
'
https://graph.facebook.com/v2.9/sample_user_id/feed?fields
'
+
url2
=
'
https://graph.facebook.com/v2.9/sample_user_id/feed?fields
'
+
'
=&limit=5&since=&access_token=
'
+
'
=&limit=5&since=&access_token=
'
+
'
sample_token&__paging_token=sample_paging_token
'
,
'
sample_token&__paging_token=sample_paging_token
'
,
body1
=
'
{"data": [{"created_time": "2016", "id": "1",
'
+
body1
=
'
{"data": [{"created_time": "2016", "id": "1",
'
+
'
"message": "Test 1"}, {"created_time": "2016", "id": "2",
'
+
'
"message": "Test 1"}, {"created_time": "2016", "id": "2",
'
+
'
"message": "Test 2"}, {"created_time": "2016", "id": "3",
'
+
'
"message": "Test 2"}, {"created_time": "2016", "id": "3",
'
+
'
"message": "Test 3"}, {"created_time": "2016", "id": "4",
'
+
'
"message": "Test 3"}, {"created_time": "2016", "id": "4",
'
+
'
"message": "Test 4"}, {"created_time": "2016", "id": "5",
'
+
'
"message": "Test 4"}, {"created_time": "2016", "id": "5",
'
+
'
"message": "Test 5"}, {"created_time": "2016", "id": "6",
'
+
'
"message": "Test 5"}, {"created_time": "2016", "id": "6",
'
+
'
"message": "Test 6"}, {"created_time": "2016", "id": "7",
'
+
'
"message": "Test 6"}, {"created_time": "2016", "id": "7",
'
+
'
"message": "Test 7"}], "paging": {"next":"
'
+
url2
+
'
",
'
+
'
"message": "Test 7"}], "paging": {"next":"
'
+
url2
+
'
",
'
+
'
"previous": null}}
'
,
'
"previous": null}}
'
,
body2
=
'
{"data": [], "paging": {"next": null, "previous": null}}
'
,
body2
=
'
{"data": [], "paging": {"next": null, "previous": null}}
'
,
server
=
this
.
server
,
server
=
this
.
server
,
return_object
=
{
"
data
"
:
{
return_object
=
{
"
data
"
:
{
"
rows
"
:
[
"
rows
"
:
[
{
{
"
id
"
:
"
3
"
,
"
id
"
:
"
3
"
,
"
value
"
:
{}
"
value
"
:
{}
},
},
{
{
"
id
"
:
"
4
"
,
"
id
"
:
"
4
"
,
"
value
"
:
{}
"
value
"
:
{}
},
},
{
{
"
id
"
:
"
5
"
,
"
id
"
:
"
5
"
,
"
value
"
:
{}
"
value
"
:
{}
}
}
],
],
"
total_rows
"
:
3
"
total_rows
"
:
3
}
}
};
};
this
.
server
.
respondWith
(
"
GET
"
,
url1
,
[
200
,
{
this
.
server
.
respondWith
(
"
GET
"
,
url1
,
[
200
,
{
"
Content-Type
"
:
"
text/xml
"
"
Content-Type
"
:
"
text/xml
"
},
body1
},
body1
]);
]);
this
.
server
.
respondWith
(
"
GET
"
,
url2
,
[
200
,
{
this
.
server
.
respondWith
(
"
GET
"
,
url2
,
[
200
,
{
"
Content-Type
"
:
"
text/xml
"
"
Content-Type
"
:
"
text/xml
"
},
body2
},
body2
]);
]);
stop
();
stop
();
expect
(
10
);
expect
(
10
);
this
.
jio
.
allDocs
({
'
limit
'
:
[
2
,
5
]})
this
.
jio
.
allDocs
({
'
limit
'
:
[
2
,
5
]})
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
equal
(
server
.
requests
.
length
,
2
);
equal
(
server
.
requests
.
length
,
2
);
equal
(
server
.
requests
[
0
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
0
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
1
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
1
].
method
,
"
GET
"
);
equal
(
server
.
requests
[
0
].
url
,
url1
);
equal
(
server
.
requests
[
0
].
url
,
url1
);
equal
(
server
.
requests
[
1
].
url
,
url2
);
equal
(
server
.
requests
[
1
].
url
,
url2
);
equal
(
server
.
requests
[
0
].
status
,
200
);
equal
(
server
.
requests
[
0
].
status
,
200
);
equal
(
server
.
requests
[
1
].
status
,
200
);
equal
(
server
.
requests
[
1
].
status
,
200
);
equal
(
server
.
requests
[
0
].
responseText
,
body1
);
equal
(
server
.
requests
[
0
].
responseText
,
body1
);
equal
(
server
.
requests
[
1
].
responseText
,
body2
);
equal
(
server
.
requests
[
1
].
responseText
,
body2
);
deepEqual
(
result
,
return_object
);
deepEqual
(
result
,
return_object
);
})
})
.
fail
(
function
(
error
)
{
.
fail
(
function
(
error
)
{
ok
(
false
,
error
);
ok
(
false
,
error
);
})
})
.
always
(
function
()
{
.
always
(
function
()
{
start
();
start
();
});
});
});
});
});
}(
jIO
,
QUnit
,
sinon
));
}(
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