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
Tatuya Kamada
gitlab-ce
Commits
fec7c99e
Commit
fec7c99e
authored
Dec 21, 2015
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates tests style for four-phase-testing as per:
https://robots.thoughtbot.com/four-phase-test
parent
531d06d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
spec/javascripts/issue_spec.js.coffee
spec/javascripts/issue_spec.js.coffee
+17
-1
No files found.
spec/javascripts/issue_spec.js.coffee
View file @
fec7c99e
...
...
@@ -30,29 +30,45 @@ describe 'reopen/close issue', ->
expect
(
obj
.
type
).
toBe
(
'PUT'
)
expect
(
obj
.
url
).
toBe
(
'http://gitlab/issues/6/close'
)
obj
.
success
saved
:
true
# setup
$btnClose
=
$
(
'a.btn-close'
)
$btnReopen
=
$
(
'a.btn-reopen'
)
expect
(
$btnReopen
.
hasClass
(
'hidden'
)).
toBe
(
true
)
expect
(
$btnClose
.
text
()).
toBe
(
'Close'
)
expect
(
typeof
$btnClose
.
prop
(
'disabled'
)).
toBe
(
'undefined'
)
# excerize
$btnClose
.
trigger
(
'click'
)
# verify
expect
(
$btnClose
.
hasClass
(
'hidden'
)).
toBe
(
true
)
expect
(
$btnReopen
.
hasClass
(
'hidden'
)).
toBe
(
false
)
expect
(
$btnClose
.
prop
(
'disabled'
)).
toBe
(
false
)
expect
(
$
(
'div.issue-box-open'
).
hasClass
(
'hidden'
)).
toBe
(
true
)
expect
(
$
(
'div.issue-box-closed'
).
hasClass
(
'hidden'
)).
toBe
(
false
)
# teardown
it
'reopens an issue'
,
->
$
.
ajax
=
(
obj
)
->
expect
(
obj
.
type
).
toBe
(
'PUT'
)
expect
(
obj
.
url
).
toBe
(
'http://gitlab/issues/6/reopen'
)
obj
.
success
saved
:
true
# setup
$btnClose
=
$
(
'a.btn-close'
)
$btnReopen
=
$
(
'a.btn-reopen'
)
expect
(
typeof
$btnReopen
.
prop
(
'disabled'
)).
toBe
(
'undefined'
)
expect
(
$btnReopen
.
text
()).
toBe
(
'Reopen'
)
# excerize
$btnReopen
.
trigger
(
'click'
)
# verify
expect
(
$btnReopen
.
hasClass
(
'hidden'
)).
toBe
(
true
)
expect
(
$btnClose
.
hasClass
(
'hidden'
)).
toBe
(
false
)
expect
(
$btnReopen
.
prop
(
'disabled'
)).
toBe
(
false
)
expect
(
$
(
'div.issue-box-open'
).
hasClass
(
'hidden'
)).
toBe
(
false
)
expect
(
$
(
'div.issue-box-closed'
).
hasClass
(
'hidden'
)).
toBe
(
true
)
# teardown
\ 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