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
2cee0faa
Commit
2cee0faa
authored
Dec 04, 2014
by
Gergely Ujvari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for reply permissions
parent
a1ae261d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
annotation-test.coffee
tests/js/directives/annotation-test.coffee
+11
-1
No files found.
tests/js/directives/annotation-test.coffee
View file @
2cee0faa
...
...
@@ -6,6 +6,7 @@ describe 'h.directives.annotation', ->
$document
=
null
$scope
=
null
$timeout
=
null
rootScope
=
null
annotator
=
null
annotation
=
null
createController
=
null
...
...
@@ -20,6 +21,7 @@ describe 'h.directives.annotation', ->
$timeout
=
_$timeout_
$scope
=
$rootScope
.
$new
()
$scope
.
annotationGet
=
(
locals
)
->
annotation
rootScope
=
$rootScope
annotator
=
{
plugins
:
{},
publish
:
sandbox
.
spy
()}
annotation
=
id
:
'deadbeef'
...
...
@@ -45,6 +47,7 @@ describe 'h.directives.annotation', ->
beforeEach
->
controller
=
createController
()
rootScope
.
persona
=
'acct:bill@localhost'
annotation
.
permissions
=
read
:
[
'acct:joe@localhost'
]
update
:
[
'acct:joe@localhost'
]
...
...
@@ -70,11 +73,18 @@ describe 'h.directives.annotation', ->
newAnnotation
=
annotator
.
publish
.
lastCall
.
args
[
1
]
assert
.
include
(
newAnnotation
.
permissions
.
read
,
'group:__world__'
)
it
'does not add the world readable principal if the parent is priva
c
e'
,
->
it
'does not add the world readable principal if the parent is priva
t
e'
,
->
controller
.
reply
()
newAnnotation
=
annotator
.
publish
.
lastCall
.
args
[
1
]
assert
.
notInclude
(
newAnnotation
.
permissions
.
read
,
'group:__world__'
)
it
'fills the other permissions too'
,
->
controller
.
reply
()
newAnnotation
=
annotator
.
publish
.
lastCall
.
args
[
1
]
assert
.
equal
(
newAnnotation
.
permissions
.
update
[
0
],
'acct:bill@localhost'
)
assert
.
equal
(
newAnnotation
.
permissions
.
delete
[
0
],
'acct:bill@localhost'
)
assert
.
equal
(
newAnnotation
.
permissions
.
admin
[
0
],
'acct:bill@localhost'
)
describe
'#render'
,
->
controller
=
null
...
...
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