Skip to content

Commit

Permalink
test: using extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
btford committed Apr 21, 2014
1 parent 85f67d4 commit d727676
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions markdown.spec.js
Expand Up @@ -40,3 +40,31 @@ describe('btfMarkdown', function () {
});

});

describe('markdownConverterProvider', function () {
var $compile,
$rootScope;

// module that adds config
angular.module('testModule', []).
config(function (markdownConverterProvider) {
markdownConverterProvider.config({
extensions: ['twitter']
});
});

beforeEach(module('ngSanitize'));
beforeEach(module('btford.markdown'));
beforeEach(module('testModule'));

beforeEach(inject(function (_$compile_, _$rootScope_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
}));

it('should allow extensions', function () {
var elt = angular.element('<btf-markdown>@briantford</btf-markdown>');
$compile(elt)($rootScope);
expect(elt.html()).toBe('<p><a href="http://twitter.com/briantford">@briantford</a></p>');
})
})

0 comments on commit d727676

Please sign in to comment.