summaryrefslogtreecommitdiffstats
path: root/js/tests/unit/controller/NavigationControllerSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/controller/NavigationControllerSpec.js')
-rw-r--r--js/tests/unit/controller/NavigationControllerSpec.js15
1 files changed, 15 insertions, 0 deletions
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');
+ }));
+
});