Skip to content

Instantly share code, notes, and snippets.

@DBA
Created May 5, 2009 13:47
Show Gist options
  • Save DBA/106971 to your computer and use it in GitHub Desktop.
Save DBA/106971 to your computer and use it in GitHub Desktop.
Given /I have at least one (.+)/ do |object_type|
case object_type
when "skin color"
Factory(:skin_color)
when "hair color"
Factory(:hair_color)
when "eye color"
Factory(:eye_color)
when "line type"
Factory(:love_line_type)
when "tag"
Factory(:tag)
end
end
Given /^I have love lines titled (.+)$/ do |titles|
titles.split(', ').each do |title|
Factory(:love_line, :header => title, :love_line_type => LoveLineType.first, :hair_color => HairColor.first,
:eye_color => EyeColor.first, :skin_color => SkinColor.first, :tag_list => Tag.all)
end
end
Given /^I have no love lines$/ do
LoveLine.delete_all
end
Then /^I should have ([0-9]+) love line(s?)$/ do |count, plural|
LoveLine.count.should == count.to_i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment