Przeglądaj źródła

refine beta opt-in workflow.

Shane Kilkelly 10 lat temu
rodzic
commit
90dac348ff

+ 1 - 1
services/web/app/coffee/Features/BetaProgram/BetaProgramController.coffee

@@ -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

+ 3 - 1
services/web/app/views/beta_program/opt_in.jade

@@ -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")}

+ 2 - 1
services/web/test/UnitTests/coffee/BetaProgram/BetaProgramControllerTests.coffee

@@ -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