<commit_before>'use strict';

describe('Stories Model', function () {
    var $http, StoriesModel;

    beforeEach(module('Angello.Common'));

    beforeEach(module(function($provide) {
        $provide.value('AuthModel', {
            getCurrentUserId: function(){
                return 1;
            }
        });

        $provide.value('ENDPOINT_URI', function(){
            return 'http://test.com';
        })
    }));

    beforeEach(inject(function ($httpBackend, _StoriesModel_) {
        $http = $httpBackend;
        StoriesModel = _StoriesModel_;

        $http.when('GET', 'https://angello.firebaseio.com/clients/1/stories/.json').respond({
            '-JHSpH5x_TdTxmCSEgs6': {
                assignee: "-JHSp9umZMUEu6Dc7Wut",
                criteria: "It tests!",
                description: "This is a test",
                reporter: "-JHSp14iy601A1AKil5s",
                status: "To Do",
                title: "Test",
                type: "Feature"
        }});
    }));

    afterEach(function() {
        $http.verifyNoOutstandingExpectation();
        $http.verifyNoOutstandingRequest();
    });

    it('test', function () {
        StoriesModel.all();
        $http.flush();
    });
});<commit_msg>added StoriesModel test<commit_after>'use strict';

describe('Stories Model', function () {
    var $http;

    beforeEach(module('Angello.Common'));

    beforeEach(module(function($provide) {
        $provide.value('AuthModel', {
            getCurrentUserId: function(){
                return 1;
            }
        });

        $provide.value('ENDPOINT_URI', function(){
            return 'http://test.com';
        })
    }));

    afterEach(inject(function($httpBackend) {
        $httpBackend.verifyNoOutstandingExpectation();
        $httpBackend.verifyNoOutstandingRequest();
    }));

    it('test1', inject(function(StoriesModel, $httpBackend, $rootScope) {
        var response = {a:3};
        $httpBackend.when('GET', 'https://angello.firebaseio.com/clients/1/stories/.json').respond(response);

        var promise = StoriesModel.all();
        $httpBackend.flush();
        
        promise.then(function(result) {
            expect(result.data).toEqual(response);
        });
        $rootScope.$digest();
    })); 

    it('test1', inject(function(StoriesModel, $httpBackend, $rootScope) {
        var response = {a:4};
        $httpBackend.when('GET', 'https://angello.firebaseio.com/clients/2/stories/.json').respond(response);

        var promise = StoriesModel.all();
        $httpBackend.flush();
        
        promise.then(function(result) {
            expect(result.data).toEqual(response);
        });
        $rootScope.$digest();
    })); 
});
{'fraction_non_alphanumeric': 0.1567109144542773, 'fraction_numerical': 0.007743362831858407, 'mean_word_length': 2.2182680901542113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4816282', 'n_tokens_mistral': 810, 'n_tokens_neox': 795, 'n_words': 110}