/*jshint node: true */
'use strict';

/*
* Name :  BarChartControllerSpec.js
* Module : UnitTest
* Location : /frontend/test/unit/Controller
*
* History :
* Version       Date        Programmer                  Description
* =================================================================================================
* 0.1.2         2015-06-24  Francesco Rossetto			fix describe 'BarChartController'
*
* 0.1.1         2015-06-23  Francesco Rossetto			fix configGraph
*
* 0.1.0         2015-05-25  Francesco Rossetto			Add all attributes and all methods
*
* 0.0.1         2015-05-25  Francesco Rossetto			Initial code      
* =================================================================================================
*
*/

describe('BarChartController', function(){

	var scope;
	var controller;

	beforeEach(function(){
		angular.mock.module('norris-nrti');
		inject(function($rootScope, $controller){
			scope = $rootScope.$new();
			controller = $controller('BarChartController', { $scope : scope });
		});
	});

	it('scope.barChart is defined', function() {
		expect(scope.barChart).toBeDefined();
	});

	it('controller is defined', function() {
		expect(controller).toBeDefined();
	});

	describe('socketConnection', function(){

		beforeEach(function(){
			controller.socketConnection('http://norris-nrti-dev.herokuapp.com/page1/bar1');
		});

		it('socketConnection works fine', function(){
			expect(scope.socket).toBeDefined();
			expect(scope.count).toEqual(1);
		});
	});
});
@@ -1026,37 +1026,34 @@
 ;%0A%0A%09
-it('scope.barChart is defined
+describe('socketConnection
 ', f
@@ -1065,72 +1065,146 @@
 on()
- 
 %7B
+%0A
 %0A%09%09
-expect(scope.barChart).toBeDefined(
+beforeEach(function()%7B%0A%09%09%09controller.socketConnection('http://norris-nrti-dev.herokuapp.com/page1/bar1'
 );%0A
+%09
 %09%7D);%0A%0A
+%09
 %09it('
+s
 co
-ntroller
+pe.barChart
  is 
@@ -1232,25 +1232,30 @@
 %7B%0A%09%09
+%09
 expect(
+s
 co
-ntroller
+pe.barChart
 ).to
@@ -1271,41 +1271,42 @@
 ();%0A
+%09
 %09%7D);%0A%0A%09
-describe('socketConnection
+%09it('controller is defined
 ', f
@@ -1318,116 +1318,45 @@
 on()
+ 
 %7B
-%0A
 %0A%09%09
-beforeEach(function()%7B%0A%09%09%09controller.socketConnection('http://norris-nrti-dev.herokuapp.com/page1/bar1'
+%09expect(controller).toBeDefined(
 );%0A%09

fix bar chart controller spec