<commit_before>'use strict';
/*jslint nomen: true newcap: true */
var describe, beforeEach, afterEach, it, inject, expect, sinon;

describe('rgiAssessmentAdminDetailCtrl', function () {
    beforeEach(module('app'));

    var $scope, $routeParams, rgiAnswerSrvc, rgiAssessmentSrvc, rgiUserListSrvc;
    var assessment_ID = 'assessment_ID', $routeParamsAssessment_ID;
    var answerQueryStub, answerQuerySpy;
    var userListGetStub, userListGetSpy;
    var assessmentGetStub, assessmentGetSpy;

    var assessment = {
        reviewer_ID: 'reviewer',
        researcher_ID: 'researcher',
        assignment: {
            assigned_by: 'assignee'
        },
        modified: [{
            modified_by: 'modifier'
        }],
        assessment_ID: 'assessment'
    };

    beforeEach(inject(
        function ($rootScope, $controller, _$routeParams_, _rgiAnswerSrvc_, _rgiAssessmentSrvc_, _rgiUserListSrvc_) {
            $routeParams = _$routeParams_;
            rgiAnswerSrvc = _rgiAnswerSrvc_;
            rgiAssessmentSrvc = _rgiAssessmentSrvc_;
            rgiUserListSrvc = _rgiUserListSrvc_;

            answerQuerySpy = sinon.spy(function() {
                return 'QUESTION LIST';
            });
            answerQueryStub = sinon.stub(rgiAnswerSrvc, 'query', answerQuerySpy);

            userListGetSpy = sinon.spy(function(object) {
                var dataMap = {
                    reviewer: 'REVIEWER',
                    researcher: 'RESEARCHER',
                    assignee: 'ASSIGNEE',
                    modifier: 'MODIFIER'
                };

                return dataMap[object._id];
            });
            userListGetStub = sinon.stub(rgiUserListSrvc, 'get', userListGetSpy);

            assessmentGetSpy = sinon.spy(function(uselessAssessmentParams, callback) {
                callback(assessment);
            });
            assessmentGetStub = sinon.stub(rgiAssessmentSrvc, 'get', assessmentGetSpy);

            $routeParamsAssessment_ID = $routeParams.assessment_ID;
            $scope = $rootScope.$new();
            $routeParams.assessment_ID = assessment_ID;
            $controller('rgiAssessmentAdminDetailCtrl', {$scope: $scope});
        }
    ));

    it('initializes sorting options', function () {
        _.isEqual($scope.sort_options, [
            {value: "question_order", text: "Sort by Question Number"},
            {value: "component_id", text: "Sort by Component"},
            {value: "status", text: "Sort by Status"}
        ]).should.be.equal(true);
    });

    it('initializes sorting order', function () {
        $scope.sortOrder.should.be.equal('question_order');
    });<commit_msg>alligned rgiAssessmentAdminDetailCtrl tests<commit_after>'use strict';
/*jslint nomen: true newcap: true */
var describe, beforeEach, afterEach, it, inject, expect, sinon;

describe('rgiAssessmentAdminDetailCtrl', function () {
    beforeEach(module('app'));

    var $scope, $routeParams, rgiAnswerSrvc, rgiAssessmentSrvc, rgiUserListSrvc;
    var assessment_ID = 'assessment_ID', $routeParamsAssessment_ID;
    var answerQueryStub, answerQuerySpy;
    var userListGetStub, userListGetSpy;
    var assessmentGetStub, assessmentGetSpy;

    var assessment = {
        reviewer_ID: 'reviewer',
        researcher_ID: 'researcher',
        assignment: {
            assigned_by: 'assignee'
        },
        modified: [{
            modified_by: 'modifier'
        }],
        assessment_ID: 'assessment'
    };

    beforeEach(inject(
        function ($rootScope, $controller, _$routeParams_, _rgiAnswerSrvc_, _rgiAssessmentSrvc_, _rgiUserListSrvc_) {
            $routeParams = _$routeParams_;
            rgiAnswerSrvc = _rgiAnswerSrvc_;
            rgiAssessmentSrvc = _rgiAssessmentSrvc_;
            rgiUserListSrvc = _rgiUserListSrvc_;

            answerQuerySpy = sinon.spy(function() {
                return 'QUESTION LIST';
            });
            answerQueryStub = sinon.stub(rgiAnswerSrvc, 'query', answerQuerySpy);

            userListGetSpy = sinon.spy(function(object) {
                var dataMap = {
                    reviewer: 'REVIEWER',
                    researcher: 'RESEARCHER',
                    assignee: 'ASSIGNEE',
                    modifier: 'MODIFIER'
                };

                return dataMap[object._id];
            });
            userListGetStub = sinon.stub(rgiUserListSrvc, 'get', userListGetSpy);

            assessmentGetSpy = sinon.spy(function(uselessAssessmentParams, callback) {
                callback(assessment);
            });
            assessmentGetStub = sinon.stub(rgiAssessmentSrvc, 'get', assessmentGetSpy);

            $routeParamsAssessment_ID = $routeParams.assessment_ID;
            $scope = $rootScope.$new();
            $routeParams.assessment_ID = assessment_ID;
            $controller('rgiAssessmentAdminDetailCtrl', {$scope: $scope});
        }
    ));

    it('initializes sorting options', function () {
        _.isEqual($scope.sort_options, [
            {value: "question_order", text: "Sort by Question Number"},
            {value: "component_id", text: "Sort by Component"},
            {value: "status", text: "Sort by Status"}
        ]).should.be.equal(true);
    });

    it('initializes sorting order', function () {
        $scope.sort_order.should.be.equal('question_order');
    });
{'fraction_non_alphanumeric': 0.11063352644365539, 'fraction_numerical': 0.0, 'mean_word_length': 2.3766561514195583, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6962776', 'n_tokens_mistral': 1623, 'n_tokens_neox': 1558, 'n_words': 284}