diff --git a/test/integration/search_popup_test.rb b/test/integration/search_popup_test.rb new file mode 100644 index 0000000..abc6163 --- /dev/null +++ b/test/integration/search_popup_test.rb @@ -0,0 +1,18 @@ +require "#{File.dirname(__FILE__)}/../test_helper" + +class SearchPopupTest < ActionController::IntegrationTest + + should 'link to search without category when not inside a filter' do + get '/' + assert_tag :tag => 'a', :attributes => { :href => '/search/popup' } + end + + should 'link to search with category when inside a filter' do + parent = Category.create!(:name => 'cat1', :environment => Environment.default) + Category.create!(:name => 'subcat', :environment => Environment.default, :parent => parent) + + get '/cat/cat1/subcat' + assert_tag :tag => 'a', :attributes => { :href => '/search/popup/cat1/subcat' } + end + +end -- libgit2 0.21.2