Commit fa0fae86 authored by gergely-ujvari's avatar gergely-ujvari Committed by Randall Leeds

searchfilter uses tag instead of tags

parent 9ffe1bbc
...@@ -110,7 +110,7 @@ class SearchFilter ...@@ -110,7 +110,7 @@ class SearchFilter
terms: since terms: since
operator: 'and' operator: 'and'
lowercase: false lowercase: false
tag: tags:
terms: tag terms: tag
operator: 'and' operator: 'and'
lowercase: true lowercase: true
......
...@@ -136,7 +136,6 @@ describe 'h.directives', -> ...@@ -136,7 +136,6 @@ describe 'h.directives', ->
describe '.simpleSearch', -> describe '.simpleSearch', ->
$element = null $element = null
beforeEach -> beforeEach ->
$scope.query = {}
$scope.update = sinon.spy() $scope.update = sinon.spy()
$scope.clear = sinon.spy() $scope.clear = sinon.spy()
...@@ -152,12 +151,12 @@ describe 'h.directives', -> ...@@ -152,12 +151,12 @@ describe 'h.directives', ->
$scope.$digest() $scope.$digest()
it 'updates the search-bar', -> it 'updates the search-bar', ->
$scope.query = {query: "Test query"} $scope.query = "Test query"
$scope.$digest() $scope.$digest()
assert.equal($scope.searchtext, $scope.query.query) assert.equal($scope.searchtext, $scope.query)
it 'calls the given search function', -> it 'calls the given search function', ->
$scope.query = {query: "Test query"} $scope.query = "Test query"
$scope.$digest() $scope.$digest()
$element.trigger('submit') $element.trigger('submit')
sinon.assert.calledWith($scope.update, "Test query") sinon.assert.calledWith($scope.update, "Test query")
...@@ -167,7 +166,7 @@ describe 'h.directives', -> ...@@ -167,7 +166,7 @@ describe 'h.directives', ->
assert($scope.clear.called) assert($scope.clear.called)
it 'clears the search-bar', -> it 'clears the search-bar', ->
$scope.query = {query: "Test query"} $scope.query = "Test query"
$scope.$digest() $scope.$digest()
$element.find('.simple-search-clear').click() $element.find('.simple-search-clear').click()
assert.equal($scope.searchtext, '') assert.equal($scope.searchtext, '')
...@@ -177,7 +176,7 @@ describe 'h.directives', -> ...@@ -177,7 +176,7 @@ describe 'h.directives', ->
assert.include($form.prop('className'), 'simple-search-inactive') assert.include($form.prop('className'), 'simple-search-inactive')
it 'removes the class from the form when there is an input value', -> it 'removes the class from the form when there is an input value', ->
$scope.query = {query: "Test query"} $scope.query = "Test query"
$scope.$digest() $scope.$digest()
$form = $element.find('.simple-search-form') $form = $element.find('.simple-search-form')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment