Sha256: 65b64263566b62518af921dff0e1c146275541370759c4cec02ef4f859d6c883

Contents?: true

Size: 901 Bytes

Versions: 3

Compression:

Stored size: 901 Bytes

Contents

describe('ListKeysController', function(){
  describe('keys', function(){
    var scope,
      location;

    // mocking keys resource to return []
    var keysResource = {
      get: function(){
        return [];
      }
    }

    beforeEach(module('memcached-keys'));

    beforeEach(inject(function($rootScope, $controller, $location){
      window.basePath = '';
      location = $location;
      scope = $rootScope.$new();
      ctrl = $controller('ListKeysController', {
        $scope: scope,
        Keys: keysResource,
        $state: {
          transitionTo: function() {
            location.path('/');
          }
        }
      });
    }));

    it('sets up the keys attribute with Keys resource call', function(){
      expect(scope.keys).toEqual([]);
    });

    it('should show keys', function() {
      scope.showKeys();
      expect(location.path()).toBe('/');
    })
  });
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
memcached-manager-1.0.0 spec/javascripts/angular/controllers/list_keys_controller_spec.js
memcached-manager-0.4.0 spec/javascripts/angular/controllers/list_keys_controller_spec.js
memcached-manager-0.3.0 spec/javascripts/angular/controllers/list_keys_controller_spec.js