Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
095430d2
Commit
095430d2
authored
Jan 17, 2015
by
ujvari
Committed by
Randall Leeds
Jan 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a new test case for store-service
parent
5b39527f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
store-service-test.coffee
tests/js/store-service-test.coffee
+18
-2
No files found.
tests/js/store-service-test.coffee
View file @
095430d2
...
...
@@ -33,11 +33,13 @@ describe 'store', ->
$httpBackend
=
_$httpBackend_
store
=
_store_
it
'reads the operations from the backend'
,
->
$httpBackend
.
expectGET
(
'http://example.com/api'
).
respond
links
:
annotation
:
create
:
{}
create
:
{
method
:
'POST'
url
:
'http://example.com/api/annotations'
}
delete
:
{}
read
:
{}
update
:
{}
...
...
@@ -47,6 +49,20 @@ describe 'store', ->
url
:
'http://0.0.0.0:5000/api/roar'
$httpBackend
.
flush
()
it
'reads the operations from the backend'
,
->
assert
.
isFunction
(
store
.
annotation
)
assert
.
isFunction
(
store
.
beware_dragons
)
assert
.
isFunction
(
store
.
search
)
it
'saves a new annotation'
,
->
annotation
=
{
id
:
'test'
}
annotation
=
new
store
.
annotation
(
annotation
)
saved
=
{}
annotation
.
$create
().
then
->
assert
.
isNotNull
(
saved
.
id
)
$httpBackend
.
expectPOST
(
'http://example.com/api/annotations'
,
annotation
).
respond
->
saved
.
id
=
annotation
.
id
return
[
201
,
{},
{}]
$httpBackend
.
flush
()
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