Unit testing AngularJS Directive doesn't appear to execute Directive's Controller
<p>I've followed a number of guides for unit testing a (simple) custom directive, but am puzzled by the fact that the directive seemingly doesn't get executed (Directive controller never fires).  I am calling scope.$digest to execute a digest cycle.</p>

<p><a href="http://jsfiddle.net/470642yq/8/" rel="nofollow">Fiddle</a>
:</p>

<pre><code>//--- CODE --------------------------

angular.module("foo", [])
.directive('CreditCardDisplay', function () {
    return {
        restrict: 'E',
        scope: {
            card: '@'
        },
        controllerAs: 'vm',
        bindToController: true,
        controller: function () {
            var mask = null;
            console.log("in CreditCardDisplay, card: " + this.card);
            if (!_.isEmpty(this.card)) {
                var length = this.card.length;

                var card = this.card.slice(-4);

                switch (length) {
                    case 14:
                        mask = "****-******-";
                        break;
                    case 15:
                        mask = "****-******-*";
                        break;
                    case 16:
                        mask = "****-****-****-";
                        break;
                    default:
                        var l1 = Math.floor((length - 4) / 4);
                        var l2 = length - 4 - (l1 * 4);
                        mask = _.repeat("****-", l1) + _.repeat("*", l2) + "-";
                }
            }

            this.mask = mask ? mask + card : card;
        },
        template: '&lt;span&gt;{{vm.mask}}&lt;/span&gt;'
    };
});
</code></pre>

<p>// ---SPECS-------------------------</p>

<pre><code>describe("directive: gpCreditCardDisplay", function () {
    var element, scope, innerScope, elementCtrl;
    beforeEach(function () {
        module('foo');

        element = angular.element('&lt;credit-card-display card="12345678901234"/&gt;');

        inject(function($rootScope, $compile) {
            scope = $rootScope.$new();
            $compile(element)(scope);
            scope.$digest();
            innerScope = element.isolateScope;
            elementCtrl = innerScope.vm;
        });
    });

    // credit card

    it("when getting a 14 digit credit card number should return correctly formatted", function () {
        expect(element.text()).toContain("****-******-1234");
    });
});
</code></pre>