Ignore:
Timestamp:
Apr 24, 2015, 1:03:31 PM (9 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Imported latest envjasmine version, the initial import from darcs had the wrong version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyenvjasmine/envjasmine/specs/ajaxDemo.spec.js

    r0 r19  
    1 // Load the file to test here.
    2 //
    3 // Example:
    41EnvJasmine.load(EnvJasmine.jsDir + "ajaxDemo.js");
    52
    6 // This is the test code.
    7 describe("AjaxDemo", function () {
    8     it("calls the addDataToDOM function on success", function () {
    9         TwitterWidget.makeRequest(); // Make the AJAX call
    10 
    11         spyOn(TwitterWidget, "addDataToDOM"); // Add a spy to the callback
    12 
    13         mostRecentAjaxRequest().response({status: 200, responseText: "foo"}); // Mock the response
    14 
    15         expect(TwitterWidget.addDataToDOM).toHaveBeenCalledWith("foo");
     3describe('greetUser', function () {
     4    it('calls greeter on success', function () {
     5        NS.greetUser(1);
     6        spyOn(NS, 'greeter');
     7        mostRecentAjaxRequest().response({
     8            status: 200,
     9            responseText: {"name":"Trevor"}
     10        });
     11        expect(NS.greeter).toHaveBeenCalledWith('Trevor');
    1612    });
    1713});
Note: See TracChangeset for help on using the changeset viewer.