Mocking requests are used for developing and testing the applications. It can be also used for some test-driven development in RIA. It helps to develop in asynchronous mode with backend team or fake the results of diesel emissions tests.

To mock request you can use the¬†‘Ext.ux.ajax.SimManager’¬†singleton. In the following listing is presented sample mock of the ‘/users.get’ request. The ‘data’ property can get array or function as a value. I used the function to generate data.

The data are automatically sorted and split in pages.

And the working sample for 6.5.3 version.

In some cases it is better to create different javascript files with different tests scenarios and include the required one.