fix some regressions caused by the newer acts_as_list gem

Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
Reinier Balt 2011-09-13 11:15:14 +02:00
parent 92c8cfe61a
commit 4927f39594
9 changed files with 85 additions and 72 deletions

View file

@ -61,8 +61,9 @@ Then /^I should see "([^"]*)" in the context container for "([^"]*)"$/ do |todo_
todo.should_not be_nil
xpath = "xpath=//div[@id=\"c#{context.id}\"]//div[@id='line_todo_#{todo.id}']"
selenium.wait_for_element(xpath, :timeout_in_seconds => 5)
selenium.is_visible(xpath).should be_true
wait_for :timeout => 5 do
selenium.is_visible(xpath)
end
end
Then /^I should not see "([^"]*)" in the context container for "([^"]*)"$/ do |todo_description, context_name|

View file

@ -34,9 +34,18 @@ end
Given /^I have the following contexts:$/ do |table|
table.hashes.each do |context|
Given 'I have a context called "'+context[:context]+'"'
@context.hide = context[:hide] == "true" unless context[:hide].blank?
# acts_as_list puts the last added context at the top, but we want it
# at the bottom to be consistent with the table in the scenario
@context.move_to_bottom
@context.save!
end
end
Given /^I have the following contexts$/ do |table|
Given("I have the following contexts:", table)
end
Given /^I have a context "([^\"]*)" with (.*) actions$/ do |context_name, number_of_actions|
context = @current_user.contexts.create!(:name => context_name)
1.upto number_of_actions.to_i do |i|
@ -44,17 +53,6 @@ Given /^I have a context "([^\"]*)" with (.*) actions$/ do |context_name, number
end
end
Given /^I have the following contexts$/ do |table|
Context.delete_all
table.hashes.each do |hash|
context = @current_user.contexts.create!(:name => hash[:name])
unless hash[:hide].blank?
context.hide = hash[:hide] == true
context.save!
end
end
end
When /^I edit the context name in place to be "([^\"]*)"$/ do |new_context_name|
selenium.click "context_name"
fill_in "value", :with => new_context_name

View file

@ -34,6 +34,10 @@ end
Given /^I have the following projects:$/ do |table|
table.hashes.each do |project|
Given 'I have a project called "'+project[:project_name]+'"'
# acts_as_list puts the last added project at the top, but we want it
# at the bottom to be consistent with the table in the scenario
@project.move_to_bottom
@project.save!
end
end