Sha256: 88816304ae26ba1d36cd021dd8856f9a5e0d2bff005177901f1e9c40fae41a1d

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

describe("Factory Notification", function() {
  var service;
  var message;

  beforeEach(function(){
    module('keysServices');
    inject(function(Notification){
      service = Notification;
    });
    message = "Some random message";

    window.basePath = '';
  });

  describe("alert method", function(){
    it("notificates the user with an alert", function(){
      noty = jasmine.createSpy('noty');
      service.alert(message);
      expect(noty).toHaveBeenCalledWith({text: message, type: 'alert'});
    });
  });

  describe("error method", function(){
    it("notificates the user with an error", function(){
      noty = jasmine.createSpy('noty');
      service.error(message);
      expect(noty).toHaveBeenCalledWith({text: message, type: 'error'});
    });
  });

  describe("info method", function(){
    it("notificates the user with an info", function(){
      noty = jasmine.createSpy('noty');
      service.info(message);
      expect(noty).toHaveBeenCalledWith({text: message, type: 'information'});
    });
  });

  describe("success method", function(){
    it("notificates the user with as success", function(){
      noty = jasmine.createSpy('noty');
      service.success(message);
      expect(noty).toHaveBeenCalledWith({text: message, type: 'success'});
    });
  });

});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
memcached-manager-1.0.0 spec/javascripts/angular/services/notification_spec.js
memcached-manager-0.4.0 spec/javascripts/angular/services/notification_spec.js
memcached-manager-0.3.0 spec/javascripts/angular/services/notification_spec.js