remove dynamic finders from cucumber scenarios

This commit is contained in:
Reinier Balt 2013-02-27 20:02:01 +01:00
parent 2b2572a2d1
commit 48e47fc009
20 changed files with 133 additions and 134 deletions

View file

@ -1,5 +1,5 @@
When /^I delete the context "([^\"]*)"$/ do |context_name|
context = @current_user.contexts.find_by_name(context_name)
context = @current_user.contexts.where(:name => context_name).first
context.should_not be_nil
handle_js_confirm do
@ -44,7 +44,7 @@ When /^I add a new hidden context "([^"]*)"$/ do |context_name|
end
When /^I drag context "([^"]*)" above context "([^"]*)"$/ do |context_drag, context_drop|
drag_id = @current_user.contexts.find_by_name(context_drag).id
drag_id = @current_user.contexts.where(:name => context_drag).first.id
sortable_css = "div.ui-sortable div#container_context_#{drag_id}"
drag_index = context_list_find_index(context_drag)
@ -73,7 +73,7 @@ Then /^I should see that the context container for (.*) contexts is present$/ do
end
Then /^I should see the context "([^"]*)" under "([^"]*)"$/ do |context_name, state|
context = Context.find_by_name(context_name)
context = Context.where(:name => context_name).first
context.should_not be_nil
page.has_css?("div#list-contexts-#{state} div#context_#{context.id}").should be_true