Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
texjs-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Mehren
texjs-web
Commits
daedb563
Verified
Commit
daedb563
authored
7 years ago
by
Tim Alby
Committed by
David Mehren
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ignore affiliations if v1 is not configured
parent
94d9c01f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/coffee/Features/User/UserUpdater.coffee
+2
-1
2 additions, 1 deletion
app/coffee/Features/User/UserUpdater.coffee
test/unit/coffee/User/UserUpdaterTests.coffee
+3
-3
3 additions, 3 deletions
test/unit/coffee/User/UserUpdaterTests.coffee
with
5 additions
and
4 deletions
app/coffee/Features/User/UserUpdater.coffee
+
2
−
1
View file @
daedb563
...
...
@@ -133,6 +133,7 @@ removeAffiliation = (userId, email, callback = (error) ->) ->
},
callback
makeAffiliationRequest
=
(
requestOptions
,
callback
=
(
error
)
->
)
->
return
callback
(
null
)
unless
settings
?
.
apis
?
.
v1
?
.
url
# service is not configured
requestOptions
.
extraSuccessStatusCodes
||=
[]
request
{
method
:
requestOptions
.
method
...
...
This diff is collapsed.
Click to expand it.
test/unit/coffee/User/UserUpdaterTests.coffee
+
3
−
3
View file @
daedb563
...
...
@@ -19,7 +19,7 @@ describe "UserUpdater", ->
getUserByAnyEmail
:
sinon
.
stub
()
ensureUniqueEmailAddress
:
sinon
.
stub
()
@
logger
=
err
:
sinon
.
stub
(),
log
:
->
settings
=
apis
:
{
v1
:
{
url
:
''
,
user
:
''
,
pass
:
''
}
}
settings
=
apis
:
{
v1
:
{
url
:
'
v1.url
'
,
user
:
''
,
pass
:
''
}
}
@
request
=
sinon
.
stub
()
@
UserUpdater
=
SandboxedModule
.
require
modulePath
,
requires
:
"logger-sharelatex"
:
@
logger
...
...
@@ -90,7 +90,7 @@ describe "UserUpdater", ->
should
.
not
.
exist
(
err
)
@
request
.
calledOnce
.
should
.
equal
true
requestOptions
=
@
request
.
lastCall
.
args
[
0
]
expectedUrl
=
"/api/v2/users/
#{
@
stubbedUser
.
_id
}
/affiliations"
expectedUrl
=
"
v1.url
/api/v2/users/
#{
@
stubbedUser
.
_id
}
/affiliations"
requestOptions
.
url
.
should
.
equal
expectedUrl
requestOptions
.
method
.
should
.
equal
'POST'
...
...
@@ -138,7 +138,7 @@ describe "UserUpdater", ->
should
.
not
.
exist
(
err
)
@
request
.
calledOnce
.
should
.
equal
true
requestOptions
=
@
request
.
lastCall
.
args
[
0
]
expectedUrl
=
"/api/v2/users/
#{
@
stubbedUser
.
_id
}
/affiliations/"
expectedUrl
=
"
v1.url
/api/v2/users/
#{
@
stubbedUser
.
_id
}
/affiliations/"
expectedUrl
+=
encodeURIComponent
(
@
newEmail
)
requestOptions
.
url
.
should
.
equal
expectedUrl
requestOptions
.
method
.
should
.
equal
'DELETE'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment