Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
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
edx
edx-platform
Commits
2717167f
Commit
2717167f
authored
Jun 16, 2016
by
Douglas Hall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass purchase_workflow parameter through to post-FinishAuth views
parent
d544340f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
+51
-2
lms/static/js/spec/student_account/finish_auth_spec.js
+40
-0
lms/static/js/student_account/views/FinishAuthView.js
+11
-2
No files found.
lms/static/js/spec/student_account/finish_auth_spec.js
View file @
2717167f
...
...
@@ -95,6 +95,24 @@
);
});
it
(
'sends the user to the course mode selection flow with bulk purchase workflow'
,
function
()
{
// Simulate providing enrollment query string params
setFakeQueryParams
({
'?enrollment_action'
:
'enroll'
,
'?course_id'
:
COURSE_KEY
,
'?purchase_workflow'
:
'bulk'
});
ajaxSpyAndInitialize
(
this
);
// Expect that the view redirected to the course
// mode select flow with the purchase_workflow parameter
expect
(
EnrollmentInterface
.
enroll
).
toHaveBeenCalledWith
(
COURSE_KEY
,
'/course_modes/choose/'
+
COURSE_KEY
+
'/?purchase_workflow=bulk'
);
});
it
(
'sends the user to the payment flow for a paid course mode'
,
function
()
{
// Simulate providing enrollment query string params
// AND specifying a course mode.
...
...
@@ -114,6 +132,28 @@
);
});
it
(
'sends the user to the payment flow for a paid course mode with bulk purchase workflow'
,
function
()
{
// Simulate providing enrollment query string params
// AND specifying a course mode
// AND purchase workflow type.
setFakeQueryParams
({
'?enrollment_action'
:
'enroll'
,
'?course_id'
:
COURSE_KEY
,
'?course_mode'
:
'professional-no-id'
,
'?purchase_workflow'
:
'bulk'
});
ajaxSpyAndInitialize
(
this
);
// Expect that the view tried to auto-enroll the student
// with a redirect into the payment flow including the
// purchase_workflow parameter.
expect
(
EnrollmentInterface
.
enroll
).
toHaveBeenCalledWith
(
COURSE_KEY
,
'/verify_student/start-flow/'
+
COURSE_KEY
+
'/?purchase_workflow=bulk'
);
});
it
(
'sends the user to the student dashboard for an unpaid course mode'
,
function
()
{
// Simulate providing enrollment query string params
// AND specifying a course mode.
...
...
lms/static/js/student_account/views/FinishAuthView.js
View file @
2717167f
...
...
@@ -89,6 +89,15 @@
console
.
log
(
desc
);
},
appendPurchaseWorkflow
:
function
(
redirectUrl
)
{
if
(
this
.
purchaseWorkflow
)
{
// Append the purchase_workflow parameter to indicate
// whether this is a bulk purchase or a single seat purchase
redirectUrl
+=
'?purchase_workflow='
+
this
.
purchaseWorkflow
;
}
return
redirectUrl
;
},
/**
* Step 1:
* Update the user's email preferences and then proceed to the next step
...
...
@@ -125,7 +134,7 @@
The track selection page would allow the user to select the course mode
("verified", "honor", etc.) -- or, if the only course mode was "honor",
it would redirect the user to the dashboard. */
redirectUrl
=
this
.
urls
.
trackSelection
+
courseId
+
'/'
;
redirectUrl
=
this
.
appendPurchaseWorkflow
(
this
.
urls
.
trackSelection
+
courseId
+
'/'
)
;
}
else
if
(
this
.
courseMode
===
'honor'
||
this
.
courseMode
===
'audit'
)
{
/* The newer version of the course details page allows the user
to specify which course mode to enroll as. If the student has
...
...
@@ -135,7 +144,7 @@
}
else
{
/* If the user selected any other kind of course mode, send them
to the payment/verification flow. */
redirectUrl
=
this
.
urls
.
payment
+
courseId
+
'/'
;
redirectUrl
=
this
.
appendPurchaseWorkflow
(
this
.
urls
.
payment
+
courseId
+
'/'
)
;
}
/* Attempt to auto-enroll the user in a free mode of the course,
...
...
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