<commit_before>module('app', {
    setup: function() {
        this.app = $.sammy('#sammy_anchor', sammyapp);
        $.mockjax({
            url : '/api/0.1/infos',
            responseText: {"result": {"description":"af83m\u00e9dia specializes in digital communication. Our mission is to design and manage online content and communities.",
                                      "logo":"af83.png",
                                      "htags":"af83"}}
        });
        $.mockjax({
            url: '/api/0.2/meeting/opened',
            responseText: {"result":[{"name":"demo","start_date":1287493374119,"end_date":"never","roster":["root"],"metadata":{"description":"UCengine demo meetup"}},{"name":"demo2","start_date":1287493374120,"end_date":"never","roster":[],"metadata":{"description":"Meeting R&D"}}]}
        });
        $.mockjax({
            url : '/api/0.2/meeting/closed',
            responseText: {"result":[{"name":"agoroom","start_date":1287493374120,"end_date":"1287493374120","roster":["root"],"metadata":{"description":"Meeting agoroom"}}]}
        });
        $.mockjax({
            url: '/api/0.2/meeting/upcoming',
            responseText: {"result":[]}
        });
    },

    teardown: function() {
        $.mockjaxClear();
        $('#sammy_anchor').unbind('DOMSubtreeModified');
        this.app.unload();
        window.location.hash = '#/';
        $('#sammy_anchor').find('*').remove();
    }
});

function whenNotEmpty(el, callback) {
    setTimeout(function() {
        if (el.children().size() != 0)
            callback()
        else
            whenNotEmpty(el, callback);
    }, 50);
}

test("should load home page", function() {
    stop();
    whenNotEmpty($('#sammy_anchor'), function(e) {
        start();
        equals(document.title, 'Home - UCengine', "document.title");
        ok($('nav .page li:eq(0)').hasClass('on'), "hav class 'on' on first li");
        ok(!$('nav .page li:eq(1)').hasClass('on'), "no class 'on' on second li");
        $(this).unbind();
    });
    this.app.run('#/');
});

test("should load about page", function() {
    stop();
    expect(3);
    window.location.hash = '#/about';
    whenNotEmpty($('#sammy_anchor'), function(e) {
        start();
        equals(document.title, 'About - UCengine', "document.title");
        ok(!$('nav .page li:eq(0)').hasClass('on'), "not class 'on' on first li");
        ok($('nav .page li:eq(1)').hasClass('on'), "has class 'on' on second li");
        $(this).unbind();
    });
    this.app.run('#/about');
});
<commit_msg>fixed uri in test_app.js<commit_after>module('app', {
    setup: function() {
        this.app = $.sammy('#sammy_anchor', sammyapp);
        $.mockjax({
            url : '/api/0.2/infos',
            responseText: {"result": {"description":"af83m\u00e9dia specializes in digital communication. Our mission is to design and manage online content and communities.",
                                      "logo":"af83.png",
                                      "htags":"af83"}}
        });
        $.mockjax({
            url: '/api/0.2/meeting/opened',
            responseText: {"result":[{"name":"demo","start_date":1287493374119,"end_date":"never","roster":["root"],"metadata":{"description":"UCengine demo meetup"}},{"name":"demo2","start_date":1287493374120,"end_date":"never","roster":[],"metadata":{"description":"Meeting R&D"}}]}
        });
        $.mockjax({
            url : '/api/0.2/meeting/closed',
            responseText: {"result":[{"name":"agoroom","start_date":1287493374120,"end_date":"1287493374120","roster":["root"],"metadata":{"description":"Meeting agoroom"}}]}
        });
        $.mockjax({
            url: '/api/0.2/meeting/upcoming',
            responseText: {"result":[]}
        });
    },

    teardown: function() {
        $.mockjaxClear();
        $('#sammy_anchor').unbind('DOMSubtreeModified');
        this.app.unload();
        window.location.hash = '#/';
        $('#sammy_anchor').find('*').remove();
    }
});

function whenNotEmpty(el, callback) {
    setTimeout(function() {
        if (el.children().size() != 0)
            callback()
        else
            whenNotEmpty(el, callback);
    }, 50);
}

test("should load home page", function() {
    stop();
    whenNotEmpty($('#sammy_anchor'), function(e) {
        start();
        equals(document.title, 'Home - UCengine', "document.title");
        ok($('nav .page li:eq(0)').hasClass('on'), "hav class 'on' on first li");
        ok(!$('nav .page li:eq(1)').hasClass('on'), "no class 'on' on second li");
        $(this).unbind();
    });
    this.app.run('#/');
});

test("should load about page", function() {
    stop();
    expect(3);
    window.location.hash = '#/about';
    whenNotEmpty($('#sammy_anchor'), function(e) {
        start();
        equals(document.title, 'About - UCengine', "document.title");
        ok(!$('nav .page li:eq(0)').hasClass('on'), "not class 'on' on first li");
        ok($('nav .page li:eq(1)').hasClass('on'), "has class 'on' on second li");
        $(this).unbind();
    });
    this.app.run('#/about');
});

{'fraction_non_alphanumeric': 0.21544795138208195, 'fraction_numerical': 0.03058223877671045, 'mean_word_length': 2.6107572540693558, 'pattern_counts': {'":': 50, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3285442', 'n_tokens_mistral': 1668, 'n_tokens_neox': 1571, 'n_words': 275}