prevent caching of GET requests for xblock student view
STUD-1691
This commit is contained in:
@@ -87,6 +87,7 @@ define ["jquery", "js/spec_helpers/edit_helpers", "coffee/src/views/module_edit"
|
||||
expect($.ajax).toHaveBeenCalledWith(
|
||||
url: "/xblock/#{@moduleEdit.model.id}/student_view"
|
||||
type: "GET"
|
||||
cache: false
|
||||
headers:
|
||||
Accept: 'application/json'
|
||||
success: jasmine.any(Function)
|
||||
@@ -107,6 +108,7 @@ define ["jquery", "js/spec_helpers/edit_helpers", "coffee/src/views/module_edit"
|
||||
expect($.ajax).not.toHaveBeenCalledWith(
|
||||
url: "/xblock/#{@moduleEdit.model.id}/studio_view"
|
||||
type: "GET"
|
||||
cache : false
|
||||
headers:
|
||||
Accept: 'application/json'
|
||||
success: jasmine.any(Function)
|
||||
@@ -131,6 +133,7 @@ define ["jquery", "js/spec_helpers/edit_helpers", "coffee/src/views/module_edit"
|
||||
expect($.ajax).toHaveBeenCalledWith(
|
||||
url: "/xblock/#{@moduleEdit.model.id}/studio_view"
|
||||
type: "GET"
|
||||
cache: false
|
||||
headers:
|
||||
Accept: 'application/json'
|
||||
success: jasmine.any(Function)
|
||||
|
||||
@@ -38,6 +38,7 @@ define ["jquery", "underscore", "gettext", "xblock/runtime.v1",
|
||||
$.ajax(
|
||||
url: "#{decodeURIComponent(@model.url())}/#{viewName}"
|
||||
type: 'GET'
|
||||
cache: false
|
||||
headers:
|
||||
Accept: 'application/json'
|
||||
success: (fragment) =>
|
||||
|
||||
@@ -96,9 +96,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
|
||||
editButtons.first().click();
|
||||
|
||||
// Expect a request to be made to show the studio view for the container
|
||||
expect(lastRequest().url).toBe(
|
||||
'/xblock/locator-container/studio_view'
|
||||
);
|
||||
expect(lastRequest().url.startsWith('/xblock/locator-container/studio_view')).toBeTruthy();
|
||||
create_sinon.respondWithJson(requests, {
|
||||
html: mockContainerXBlockHtml,
|
||||
resources: []
|
||||
@@ -114,9 +112,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
|
||||
expect(edit_helpers.isShowingModal()).toBeFalsy();
|
||||
|
||||
// Expect the last request be to refresh the container page
|
||||
expect(lastRequest().url).toBe(
|
||||
'/xblock/locator-container/container_preview'
|
||||
);
|
||||
expect(lastRequest().url.startsWith('/xblock/locator-container/container_preview')).toBeTruthy();
|
||||
create_sinon.respondWithJson(requests, {
|
||||
html: mockUpdatedContainerXBlockHtml,
|
||||
resources: []
|
||||
@@ -153,9 +149,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
|
||||
expect(editButtons.length).toBe(6);
|
||||
editButtons[0].click();
|
||||
// Make sure that the correct xblock is requested to be edited
|
||||
expect(lastRequest().url).toBe(
|
||||
'/xblock/locator-component-A1/studio_view'
|
||||
);
|
||||
expect(lastRequest().url.startsWith('/xblock/locator-component-A1/studio_view')).toBeTruthy();
|
||||
create_sinon.respondWithJson(requests, {
|
||||
html: mockXBlockEditorHtml,
|
||||
resources: []
|
||||
|
||||
@@ -204,9 +204,7 @@ define(["jquery", "underscore", "jasmine", "coffee/src/views/unit", "js/models/m
|
||||
expect(editButtons.length).toBe(2);
|
||||
editButtons[1].click();
|
||||
// Make sure that the correct xblock is requested to be edited
|
||||
expect(lastRequest().url).toBe(
|
||||
'/xblock/loc_2/studio_view'
|
||||
);
|
||||
expect(lastRequest().url.startsWith('/xblock/loc_2/studio_view')).toBeTruthy();
|
||||
create_sinon.respondWithJson(requests, {
|
||||
html: mockXBlockEditorHtml,
|
||||
resources: []
|
||||
|
||||
@@ -17,6 +17,7 @@ define(["jquery", "underscore", "js/views/baseview", "xblock/runtime.v1"],
|
||||
return $.ajax({
|
||||
url: decodeURIComponent(xblockUrl) + "/" + view,
|
||||
type: 'GET',
|
||||
cache: false,
|
||||
headers: { Accept: 'application/json' },
|
||||
success: function(fragment) {
|
||||
self.handleXBlockFragment(fragment, options);
|
||||
|
||||
Reference in New Issue
Block a user