diff --git a/app/views/layouts/application-ng.rhtml b/app/views/layouts/application-ng.rhtml index 480e3f9..cc96b58 100644 --- a/app/views/layouts/application-ng.rhtml +++ b/app/views/layouts/application-ng.rhtml @@ -69,11 +69,13 @@ <% end %> -
- -
<%=_('Press Enter to send the search query.')%>
- <%= javascript_tag 'jQuery("#user form input").hint();' %> -
+ <% if @plugins.first(:search_engine?) %> +
+ +
<%=_('Press Enter to send the search query.')%>
+ <%= javascript_tag 'jQuery("#user form input").hint();' %> +
+ <% end %>

diff --git a/test/functional/home_controller_test.rb b/test/functional/home_controller_test.rb index 99233ef..09609d8 100644 --- a/test/functional/home_controller_test.rb +++ b/test/functional/home_controller_test.rb @@ -136,4 +136,14 @@ class HomeControllerTest < ActionController::TestCase assert_no_tag :tag => 'a', :attributes => {:href => '/account/signup'} end + should "not display search field if there is no search engine on" do + Noosfero::Plugin::Manager.any_instance.stubs(:first).with(:search_engine?).returns(false) + get :index + assert_no_tag :tag => 'input', :attributes => {:name => 'query'} + + Noosfero::Plugin::Manager.any_instance.stubs(:first).with(:search_engine?).returns(true) + get :index + assert_tag :tag => 'input', :attributes => {:name => 'query'} + end + end -- libgit2 0.21.2