ref: master
test/integration/search_popup_test.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
require_relative "../test_helper" class SearchPopupTest < ActionDispatch::IntegrationTest def setup HomeController.any_instance.stubs(:get_layout).returns('application') SearchController.any_instance.stubs(:get_layout).returns('application') end 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 |