Skip to content

Commit

Permalink
Fix search tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Guo Yunhe committed May 24, 2018
1 parent a8d23d2 commit bec21fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/views/search/_find_form.html.erb
Expand Up @@ -3,6 +3,7 @@
<%= form_tag( {:controller => 'search', :action => :index}, :method => :get ) do %>
<div class="d-flex justify-content-center">
<%= text_field_tag 'q', @search_term, :size => 30, :id => "search-form", :class => 'form-control mr-2', :placeholder => _('Search packages...'), :autocomplete => "off", :autofocus => true %>

<button type="submit" class="btn btn-primary mr-2 hidden-sm-down">
<span class="typcn typcn-lg typcn-zoom-outline"></span>
<span class="hidden-xs-down"><%= _("Search") %></span>
Expand Down
10 changes: 4 additions & 6 deletions test/system/search_results_test.rb
Expand Up @@ -6,11 +6,10 @@ def test_default_searches
visit '/'
page.fill_in 'q', with: 'nvidia'
page.find(:css, 'button#settings').click
within '#search-config-modal' do
within '#search-settings' do
find('option[value="openSUSE:Leap:42.3"]').click
end
page.click_on 'Done'
page.find('button[type="submit"]').click
page.click_on 'OK'

page.assert_text 'for instructions how to configure your NVIDIA graphics card'
end
Expand All @@ -20,11 +19,10 @@ def test_non_existing_packages
visit '/'
page.fill_in 'q', with: 'paralapapiricoipi'
page.find(:css, 'button#settings').click
within '#search-config-modal' do
within '#search-settings' do
find('option[value="openSUSE:Leap:42.3"]').click
end
page.click_on 'Done'
page.find('button[type="submit"]').click
page.click_on 'OK'

page.assert_text 'No packages found matching your search.'
end
Expand Down

0 comments on commit bec21fa

Please sign in to comment.