Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (15 sloc) 0.465 kb
class FactoryGenerator < Rails::Generator::NamedBase
def manifest
record do |m|
m.directory File.join('test/factories', class_path)
m.template 'factory.rb', File.join('test/factories', class_path, "#{file_name}_factory.rb")
end
end
def factory_line(attribute)
"#{file_name}.#{attribute.name} '#{attribute.default}'"
end
protected
def banner
"Usage: #{$0} #{spec.name} FactoryName [field:type, field:type]"
end
end
Jump to Line
Something went wrong with that request. Please try again.