mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-17 04:38:08 +01:00
fix some regressions caused by the newer acts_as_list gem
Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
parent
92c8cfe61a
commit
4927f39594
9 changed files with 85 additions and 72 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue