Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
Jérome Perrin
gitlab-ce
Commits
d2256c18
Commit
d2256c18
authored
May 06, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stub ajax in JS specs
parent
c9788bd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
spec/javascripts/issue_spec.js.coffee
spec/javascripts/issue_spec.js.coffee
+2
-1
spec/javascripts/merge_request_spec.js.coffee
spec/javascripts/merge_request_spec.js.coffee
+3
-1
No files found.
spec/javascripts/issue_spec.js.coffee
View file @
d2256c18
...
@@ -9,11 +9,12 @@ describe 'Issue', ->
...
@@ -9,11 +9,12 @@ describe 'Issue', ->
@
issue
=
new
Issue
()
@
issue
=
new
Issue
()
it
'modifies the Markdown field'
,
->
it
'modifies the Markdown field'
,
->
spyOn
(
jQuery
,
'ajax'
).
and
.
stub
()
$
(
'input[type=checkbox]'
).
attr
(
'checked'
,
true
).
trigger
(
'change'
)
$
(
'input[type=checkbox]'
).
attr
(
'checked'
,
true
).
trigger
(
'change'
)
expect
(
$
(
'.js-task-list-field'
).
val
()).
toBe
(
'- [x] Task List Item'
)
expect
(
$
(
'.js-task-list-field'
).
val
()).
toBe
(
'- [x] Task List Item'
)
it
'submits an ajax request on tasklist:changed'
,
->
it
'submits an ajax request on tasklist:changed'
,
->
spyOn
(
$
,
'ajax'
).
and
.
callFake
(
req
)
->
spyOn
(
jQuery
,
'ajax'
).
and
.
callFake
(
req
)
->
expect
(
req
.
type
).
toBe
(
'PATCH'
)
expect
(
req
.
type
).
toBe
(
'PATCH'
)
expect
(
req
.
url
).
toBe
(
'/foo'
)
expect
(
req
.
url
).
toBe
(
'/foo'
)
expect
(
req
.
data
.
issue
.
description
).
not
.
toBe
(
null
)
expect
(
req
.
data
.
issue
.
description
).
not
.
toBe
(
null
)
...
...
spec/javascripts/merge_request_spec.js.coffee
View file @
d2256c18
...
@@ -11,11 +11,13 @@ describe 'MergeRequest', ->
...
@@ -11,11 +11,13 @@ describe 'MergeRequest', ->
@
merge
=
new
MergeRequest
({})
@
merge
=
new
MergeRequest
({})
it
'modifies the Markdown field'
,
->
it
'modifies the Markdown field'
,
->
spyOn
(
jQuery
,
'ajax'
).
and
.
stub
()
$
(
'input[type=checkbox]'
).
attr
(
'checked'
,
true
).
trigger
(
'change'
)
$
(
'input[type=checkbox]'
).
attr
(
'checked'
,
true
).
trigger
(
'change'
)
expect
(
$
(
'.js-task-list-field'
).
val
()).
toBe
(
'- [x] Task List Item'
)
expect
(
$
(
'.js-task-list-field'
).
val
()).
toBe
(
'- [x] Task List Item'
)
it
'submits an ajax request on tasklist:changed'
,
->
it
'submits an ajax request on tasklist:changed'
,
->
spyOn
(
$
,
'ajax'
).
and
.
callFake
(
req
)
->
spyOn
(
jQuery
,
'ajax'
).
and
.
callFake
(
req
)
->
expect
(
req
.
type
).
toBe
(
'PATCH'
)
expect
(
req
.
type
).
toBe
(
'PATCH'
)
expect
(
req
.
url
).
toBe
(
'/foo'
)
expect
(
req
.
url
).
toBe
(
'/foo'
)
expect
(
req
.
data
.
merge_request
.
description
).
not
.
toBe
(
null
)
expect
(
req
.
data
.
merge_request
.
description
).
not
.
toBe
(
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