From c0e6ca12e83e27b2ef86a58f9a44c0248e711a75 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 21 Mar 2015 00:50:52 +0100 Subject: implement clientside search code --- js/tests/unit/controller/NavigationControllerSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'js/tests') diff --git a/js/tests/unit/controller/NavigationControllerSpec.js b/js/tests/unit/controller/NavigationControllerSpec.js index 22c510c3f..d6b016c9a 100644 --- a/js/tests/unit/controller/NavigationControllerSpec.js +++ b/js/tests/unit/controller/NavigationControllerSpec.js @@ -1038,4 +1038,19 @@ describe('NavigationController', function () { })); + it ('should set location on search', inject(function ($controller) { + var location = { + search: jasmine.createSpy('search') + }; + var ctrl = $controller('NavigationController', { + $location: location + }); + + ctrl.search(''); + expect(location.search).toHaveBeenCalledWith('search', null); + + ctrl.search('ab'); + expect(location.search).toHaveBeenCalledWith('search', 'ab'); + })); + }); -- cgit v1.2.3