'use strict';

/* jasmine specs for controllers go here */

describe('RootCtrl', function(){
    beforeEach(module('swiftBrowser.controllers'));

    it('should list containers', inject(function($controller, $httpBackend) {
        var containers = [
            {"count": 10, "bytes": 1234, "name": "foo"},
            {"count": 20, "bytes": 2345, "name": "bar"},
        ];
        var scope = {};
        $httpBackend.whenGET('/v1/AUTH_abc?format=json')
            .respond(200, containers);

        $controller('RootCtrl', {$scope: scope});
        expect(scope.containers).toEqual([]);
        $httpBackend.flush();
        expect(scope.containers).toEqual(containers);
    }));

});

@@ -680,12 +680,208 @@
   %7D));%0A%0A
+    it('should set sort order', inject(function($controller) %7B%0A        var scope = %7B%7D;%0A        $controller('RootCtrl', %7B$scope: scope%7D);%0A        expect(scope.orderProp).toEqual('name');%0A    %7D));%0A%0A
 %7D);%0A

Check that RootCtrl sets the default sort order