Sha256: 9d33c6e5cd324ac321ded899a6849a4b02acccf055f5696d692b77cc3fb93b6f
Contents?: true
Size: 700 Bytes
Versions: 25
Compression:
Stored size: 700 Bytes
Contents
require 'factory_girl_rails' require 'faker' require 'factory_girl/step_definitions' 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
25 entries across 25 versions & 1 rubygems