From c3ea1dfc6e2d094ea04bee0ef35467dfc05e7cc5 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 6 Jan 2012 11:05:40 -0800 Subject: [PATCH] DC DG fix search cucumber step --- app/controllers/people_controller.rb | 2 +- features/step_definitions/custom_web_steps.rb | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 3405bdaca..c18b9b4ce 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -22,7 +22,7 @@ class PeopleController < ApplicationController if params[:q][0] == 35 || params[:q][0] == '#' if params[:q].length > 1 tag_name = params[:q].gsub(/[#\.]/, '') - redirect_to tags_path(:q => params[:q]) + redirect_to tag_path(:name => tag_name, :q => params[:q]) return else flash[:error] = I18n.t('tags.show.none', :name => params[:q]) diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 3023c32d1..98f208e47 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -148,12 +148,8 @@ Then /^I should get download alert$/ do end When /^I search for "([^\"]*)"$/ do |search_term| - step "I fill in \"q\" with \"#{search_term}\"" - page.execute_script <<-JS - var e = jQuery.Event("keypress"); - e.keyCode = 13; - $("#q").trigger(e); - JS + fill_in "q", :with => search_term + find_field("q").native.send_key(:enter) end Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value|