DC DG fix search cucumber step

This commit is contained in:
danielgrippi 2012-01-06 11:05:40 -08:00 committed by Dennis Collinson
parent 3db0cd3776
commit c3ea1dfc6e
2 changed files with 3 additions and 7 deletions

View file

@ -22,7 +22,7 @@ class PeopleController < ApplicationController
if params[:q][0] == 35 || params[:q][0] == '#' if params[:q][0] == 35 || params[:q][0] == '#'
if params[:q].length > 1 if params[:q].length > 1
tag_name = params[:q].gsub(/[#\.]/, '') tag_name = params[:q].gsub(/[#\.]/, '')
redirect_to tags_path(:q => params[:q]) redirect_to tag_path(:name => tag_name, :q => params[:q])
return return
else else
flash[:error] = I18n.t('tags.show.none', :name => params[:q]) flash[:error] = I18n.t('tags.show.none', :name => params[:q])

View file

@ -148,12 +148,8 @@ Then /^I should get download alert$/ do
end end
When /^I search for "([^\"]*)"$/ do |search_term| When /^I search for "([^\"]*)"$/ do |search_term|
step "I fill in \"q\" with \"#{search_term}\"" fill_in "q", :with => search_term
page.execute_script <<-JS find_field("q").native.send_key(:enter)
var e = jQuery.Event("keypress");
e.keyCode = 13;
$("#q").trigger(e);
JS
end end
Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value| Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value|