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
5b39527f
Commit
5b39527f
authored
Jan 16, 2015
by
ujvari
Committed by
Randall Leeds
Jan 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test core for store service
parent
fc8266a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
store-service-test.coffee
tests/js/store-service-test.coffee
+52
-0
No files found.
tests/js/store-service-test.coffee
0 → 100644
View file @
5b39527f
assert
=
chai
.
assert
sinon
.
assert
.
expose
assert
,
prefix
:
null
describe
'store'
,
->
$httpBackend
=
null
sandbox
=
null
store
=
null
fakeDocument
=
null
beforeEach
module
(
'h'
)
beforeEach
module
(
$provide
)
->
sandbox
=
sinon
.
sandbox
.
create
()
link
=
document
.
createElement
(
"link"
)
link
.
rel
=
'service'
link
.
type
=
'application/annotatorsvc+json'
link
.
href
=
'http://example.com/api'
fakeDocument
=
{
find
:
sandbox
.
stub
().
returns
(
$
(
link
))
}
$provide
.
value
'$document'
,
fakeDocument
return
afterEach
->
sandbox
.
restore
()
beforeEach
inject
(
$q
,
_$httpBackend_
,
_store_
)
->
$httpBackend
=
_$httpBackend_
store
=
_store_
it
'reads the operations from the backend'
,
->
$httpBackend
.
expectGET
(
'http://example.com/api'
).
respond
links
:
annotation
:
create
:
{}
delete
:
{}
read
:
{}
update
:
{}
search
:
url
:
'http://0.0.0.0:5000/api/search'
beware_dragons
:
url
:
'http://0.0.0.0:5000/api/roar'
$httpBackend
.
flush
()
assert
.
isFunction
(
store
.
annotation
)
assert
.
isFunction
(
store
.
beware_dragons
)
assert
.
isFunction
(
store
.
search
)
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