mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
refine beta opt-in workflow.
This commit is contained in:
parent
20485cbfed
commit
90dac348ff
3 changed files with 6 additions and 3 deletions
|
@ -14,7 +14,7 @@ module.exports = BetaProgramController =
|
|||
BetaProgramHandler.optIn user_id, (err) ->
|
||||
if err
|
||||
return next(err)
|
||||
return res.redirect "/"
|
||||
return res.redirect "/beta/opt-in"
|
||||
|
||||
optInPage: (req, res, next)->
|
||||
user_id = req.session?.user?._id
|
||||
|
|
|
@ -18,11 +18,13 @@ block content
|
|||
.col-md-12
|
||||
if user.betaProgram
|
||||
p #{translate("beta_program_already_participating")}
|
||||
.form-group
|
||||
a(href="/project").btn.btn-info #{translate("back_to_your_projects")}
|
||||
else
|
||||
form(method="post", action="/beta/opt-in", novalidate)
|
||||
.form-group
|
||||
input(type="hidden", name="_csrf", value=csrfToken)
|
||||
button.btn.btn-lg.btn-primary(
|
||||
button.btn.btn-primary(
|
||||
type="submit"
|
||||
)
|
||||
span #{translate("beta_program_opt_in_action")}
|
||||
|
|
|
@ -44,9 +44,10 @@ describe "BetaProgramController", ->
|
|||
beforeEach ->
|
||||
@BetaProgramHandler.optIn.callsArgWith(1, null)
|
||||
|
||||
it "should redirect to '/'", () ->
|
||||
it "should redirect to '/beta/opt-in'", () ->
|
||||
@BetaProgramController.optIn @req, @res, @next
|
||||
@res.redirect.callCount.should.equal 1
|
||||
@res.redirect.firstCall.args[0].should.equal "/beta/opt-in"
|
||||
|
||||
it "should not call next with an error", () ->
|
||||
@BetaProgramController.optIn @req, @res, @next
|
||||
|
|
Loading…
Reference in a new issue