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
55e8c35d
Commit
55e8c35d
authored
May 15, 2015
by
Sean Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplication when stubbing formRespond
parent
8f92915e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
account-controller-test.coffee
h/static/scripts/account/test/account-controller-test.coffee
+3
-6
No files found.
h/static/scripts/account/test/account-controller-test.coffee
View file @
55e8c35d
...
...
@@ -311,7 +311,7 @@ describe "h:AccountController", ->
$filter
:
$filter
or
->
->
{}
auth
:
auth
or
{}
flash
:
flash
or
{}
formRespond
:
formRespond
or
{}
formRespond
:
formRespond
or
->
identity
:
identity
or
{}
session
:
session
or
getStubSession
({})
}
...
...
@@ -347,7 +347,6 @@ describe "h:AccountController", ->
edit_profile
.
returns
({
$promise
:
Promise
.
resolve
({})})
{
$scope
}
=
controller
(
formRespond
:
->
session
:
getStubSession
(
edit_profile
:
edit_profile
)
# Simulate a logged-in user with username "joeuser"
$filter
:
->
->
"joeuser"
)
...
...
@@ -374,7 +373,6 @@ describe "h:AccountController", ->
new_email_addr
=
"new_email_address@test.com"
{
$scope
}
=
controller
(
formRespond
:
->
# AccountController expects session.edit_profile() to respond with the
# newly saved email address.
session
:
getStubSession
(
...
...
@@ -431,7 +429,7 @@ describe "h:AccountController", ->
it
"broadcasts 'formState' 'changeEmailForm' 'loading' on submit"
,
->
new_email_address
=
"new_email_address@test.com"
{
$scope
}
=
controller
(
formRespond
:
->
)
{
$scope
}
=
controller
(
{}
)
$scope
.
$broadcast
=
sinon
.
stub
()
...
...
@@ -451,7 +449,7 @@ describe "h:AccountController", ->
it
"broadcasts 'formState' 'changeEmailForm' 'success' on success"
,
->
new_email_address
=
"new_email_address@test.com"
{
$scope
}
=
controller
(
formRespond
:
->
)
{
$scope
}
=
controller
(
{}
)
$scope
.
$broadcast
=
sinon
.
stub
()
...
...
@@ -473,7 +471,6 @@ describe "h:AccountController", ->
new_email_address
=
"new_email_address@test.com"
{
$scope
}
=
controller
(
formRespond
:
->
flash
:
{
error
:
->
}
session
:
getStubSession
(
edit_profile
:
->
{
$promise
:
Promise
.
reject
({
data
:
{}})}
...
...
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