Sha256: d9611ef00af898eaa267c1426ae9fc7c0b5dc18a62a20b800cf546b71631e4ef
Contents?: true
Size: 614 Bytes
Versions: 12
Compression:
Stored size: 614 Bytes
Contents
FactoryGirl.factories.each do |factory| factory.human_names.each do |human_name| if factory.build_class.respond_to?(:keys) factory.build_class.keys.each_key do |key| human_column_name = key.downcase.gsub('_', ' ') Given /^an? #{human_name} exists with an? #{human_column_name} of "([^"]*)"$/i do |value| Factory(factory.name, key => value) end Given /^(\d+) #{human_name.pluralize} exist with an? #{human_column_name} of "([^"]*)"$/i do |count, value| count.to_i.times { Factory(factory.name, key => value) } end end end end end
Version data entries
12 entries across 12 versions & 2 rubygems