mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-22 01:10:23 +00:00
27 lines
665 B
JavaScript
27 lines
665 B
JavaScript
describe("services", function(){
|
|
var scope;
|
|
|
|
beforeEach(function(){
|
|
scope = createScope({
|
|
$config: {
|
|
'location': {'get':noop, 'set':noop, 'watch':noop}
|
|
}
|
|
}, serviceAdapter(angularService));
|
|
});
|
|
|
|
it("should inject $window", function(){
|
|
expect(scope.$window).toEqual(window);
|
|
});
|
|
|
|
it("should inject $anchor", function(){
|
|
scope.$anchor('#path?key=value');
|
|
expect(scope.$anchor.path).toEqual("path");
|
|
expect(scope.$anchor.param).toEqual({key:'value'});
|
|
|
|
scope.$anchor.path = 'page=http://path';
|
|
scope.$anchor.param = {k:'a=b'};
|
|
|
|
expect(scope.$anchor()).toEqual('page=http://path?k=a%3Db');
|
|
|
|
});
|
|
});
|