BigW Consortium Gitlab

Commit fe42de3a by Kamil Trzcinski

Fix: features/ci/admin/runners_spec.rb

parent 29b3279a
...@@ -37,7 +37,7 @@ module Ci ...@@ -37,7 +37,7 @@ module Ci
acts_as_taggable acts_as_taggable
def self.search(query) def self.search(query)
where('LOWER(runners.token) LIKE :query OR LOWER(runners.description) like :query', where('LOWER(ci_runners.token) LIKE :query OR LOWER(ci_runners.description) like :query',
query: "%#{query.try(:downcase)}%") query: "%#{query.try(:downcase)}%")
end end
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
.append-bottom-20.clearfix .append-bottom-20.clearfix
.pull-left .pull-left
= form_tag ci_admin_runners_path, class: 'form-inline', method: :get do = form_tag ci_admin_runners_path, id: 'runners-search', class: 'form-inline', method: :get do
.form-group .form-group
= search_field_tag :search, params[:search], class: 'form-control', placeholder: 'Runner description or token' = search_field_tag :search, params[:search], class: 'form-control', placeholder: 'Runner description or token'
= submit_tag 'Search', class: 'btn' = submit_tag 'Search', class: 'btn'
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
%tr %tr
%td %td
= form_tag ci_admin_runner_path(@runner), class: 'form-inline', method: :get do = form_tag ci_admin_runner_path(@runner), id: 'runner-projects-search', class: 'form-inline', method: :get do
.form-group .form-group
= search_field_tag :search, params[:search], class: 'form-control' = search_field_tag :search, params[:search], class: 'form-control'
= submit_tag 'Search', class: 'btn' = submit_tag 'Search', class: 'btn'
......
...@@ -23,8 +23,9 @@ describe "Admin Runners" do ...@@ -23,8 +23,9 @@ describe "Admin Runners" do
FactoryGirl.create :ci_runner, description: 'foo' FactoryGirl.create :ci_runner, description: 'foo'
FactoryGirl.create :ci_runner, description: 'bar' FactoryGirl.create :ci_runner, description: 'bar'
fill_in 'search', with: 'foo' search_form = find('#runners-search')
click_button 'Search' search_form.fill_in 'search', with: 'foo'
search_form.click_button 'Search'
end end
it { expect(page).to have_content("foo") } it { expect(page).to have_content("foo") }
...@@ -52,8 +53,9 @@ describe "Admin Runners" do ...@@ -52,8 +53,9 @@ describe "Admin Runners" do
describe 'search' do describe 'search' do
before do before do
fill_in 'search', with: 'foo' search_form = find('#runner-projects-search')
click_button 'Search' search_form.fill_in 'search', with: 'foo'
search_form.click_button 'Search'
end end
it { expect(page).to have_content("foo") } it { expect(page).to have_content("foo") }
......
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