Skip to content

Instantly share code, notes, and snippets.

@simonmorley
Created September 26, 2014 16:00
Show Gist options
  • Save simonmorley/fd04974b7a9a4fb7042a to your computer and use it in GitHub Desktop.
Save simonmorley/fd04974b7a9a4fb7042a to your computer and use it in GitHub Desktop.
Miserable
it("should call CT's api and enable alerts for a box", function() {
expect($scope.box.is_monitored).toBe(false)
spyOn(boxFactory, 'alerts').andCallThrough()
var cont = element.find('input').controller('ngModel');
cont.$setViewValue(true);
deferred.resolve({slug: 123, is_monitored: true});
$scope.$apply()
expect($scope.status.processing).toBe(true)
expect(boxFactory.alerts).toHaveBeenCalled();
expect($scope.box.is_monitored).toBe(true)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment