Created
September 2, 2015 17:41
-
-
Save 8vius/0c2a5d6f8b6d9814526d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 #= require invoices.module | |
2 #= require invoices/perception_fields.directive | |
3 | |
4 describe "perceptionFields", -> | |
5 [scope, perceptionsCtrl] = [] | |
6 | |
7 beforeEach -> | |
8 module "app.invoices" | |
9 | |
10 inject ($compile, $rootScope) -> | |
11 perceptionsCtrl = jasmine.createSpyObj "perceptionsCtrl", [ | |
12 "registerPerception" | |
13 "removePerception" | |
14 "updateTotals" | |
15 ] | |
16 element = angular.element("<perception-fields></perception-fields>") | |
17 element.data("$perceptionsController", perceptionsCtrl) | |
18 element = $compile(element)($rootScope) | |
19 scope = element.scope() | |
20 | |
21 describe "#removePerception", -> | |
22 it "removes perception", -> | |
23 scope.removePerception() | |
24 | |
25 expect(perceptionsCtrl.removePerception).toHaveBeenCalledWith(scope.perception) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment