<commit_before>/**
 * Created by paul on 5/7/15.
 */

'use strict';
describe('Models.Server', function () {
	describe('toJson()', function () {
		it('should return valid json', function () {
			var jsServer = {
				'_id': 'ptZ6su3X5eugNSm4F',
				'name': 'IModules Teamcity',
				'type': 'teamcity',
				'url': 'http://buildserver2:90',
				'user': 'pstuart',
				'password': '<PASSWORD>'
			};

			var server = new Models.Server(jsServer);
			expect(server.toJson()).toEqual(jsServer);
		});
	});

	describe('refreshActiveBuildData()', function () {
		it('should call the refreshBuildData for the builds', function () {
			spyOn(Controllers.Builds, 'getActiveServerBuilds').and.callFake(function () {
				return [
					new Models.Build({
						'_id': 'buildId1',
						'serverId': 'kTugGKGRGJJWKDdb6',
						'projectId': 'MBP',
						'serviceBuildId': 'MBP_UnitTestAndBundle',
						'name': 'Unit Test and Bundle',
						'url': '/httpAuth/app/rest/buildTypes/id:MBP_UnitTestAndBundle',
						'isDisplayed': true,
						'isLastBuildSuccess': true,
						'isBuilding': false
					}),
					new Models.Build({
						'_id': 'buildId2',
						'serverId': 'kTugGKGRGJJWKDdb6',
						'projectId': 'MBP',
						'serviceBuildId': 'MBP_UnitTestAndBundle',
						'name': 'Unit Test and Bundle',
						'url': '/httpAuth/app/rest/buildTypes/id:MBP_UnitTestAndBundle',
						'isDisplayed': true,
						'isLastBuildSuccess': true,
						'isBuilding': false
					})
				];<commit_msg>Setting up the toggleDisplay<commit_after>/**
 * Created by paul on 5/7/15.
 */

'use strict';
describe('Models.Server', function () {
	describe('toJson()', function () {
		it('should return valid json', function () {
			var jsServer = {
				'_id': 'ptZ6su3X5eugNSm4F',
				'name': 'IModules Teamcity',
				'type': 'teamcity',
				'url': 'http://buildserver2:90',
				'user': 'pstuart',
				'password': '<PASSWORD>'
			};

			var server = new Models.Server(jsServer);
			expect(server.toJson()).toEqual(jsServer);
		});
	});

	describe('toggleBuildDisplay()', function () {
		it('should get the build and call updateIsDisplayed', function () {
			spyOn(Controllers.Builds, 'getBuild').and.callFake(function () {

			});

			expect(true).toBe(false);
		});
	});

	describe('refreshActiveBuildData()', function () {
		it('should call the refreshBuildData for the builds', function () {
			spyOn(Controllers.Builds, 'getActiveServerBuilds').and.callFake(function () {
				return [
					new Models.Build({
						'_id': 'buildId1',
						'serverId': 'kTugGKGRGJJWKDdb6',
						'projectId': 'MBP',
						'serviceBuildId': 'MBP_UnitTestAndBundle',
						'name': 'Unit Test and Bundle',
						'url': '/httpAuth/app/rest/buildTypes/id:MBP_UnitTestAndBundle',
						'isDisplayed': true,
						'isLastBuildSuccess': true,
						'isBuilding': false
					}),
					new Models.Build({
						'_id': 'buildId2',
						'serverId': 'kTugGKGRGJJWKDdb6',
						'projectId': 'MBP',
						'serviceBuildId': 'MBP_UnitTestAndBundle',
						'name': 'Unit Test and Bundle',
						'url': '/httpAuth/app/rest/buildTypes/id:MBP_UnitTestAndBundle',
						'isDisplayed': true,
						'isLastBuildSuccess': true,
						'isBuilding': false
					})
				];
{'fraction_non_alphanumeric': 0.17163476623784124, 'fraction_numerical': 0.009413241292751805, 'mean_word_length': 3.452513966480447, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4662057', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1086, 'n_words': 208}