Report abuse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
def model_factory_helper(calling_spec, model_class, options)
raise "factory_method requires default_attributes" unless options.has_key?(:default_attributes)
raise "factory_method default_attributes must be a Hash" unless options[:default_attributes].is_a?(Hash)
proper_class_name = model_class.name
lowered_class_name = model_class.name.downcase
calling_spec.instance_eval <<-"end;"
module
def end
def options = {} if options == :all
end
def end
def it_should_require_fields(*fields)
fields.each do |field|
it "should require \#{field}" do
end
end
end
end
include end;
end
|