Commit 46148145f695a5e3c569533cf4e325157b91c142

Authored by Rodrigo Souto
1 parent 9b4b80b9

rails3: use assign_attributes on factory build

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
test/factories.rb
... ... @@ -42,7 +42,7 @@ module Noosfero::Factory
42 42 attrs[:slug] = attrs[:name].to_slug if attrs[:name].present? && attrs[:slug].blank? && defaults[:slug].present?
43 43 data = defaults_for(name).merge(attrs)
44 44 object = name.to_s.camelize.constantize.new
45   - data.each { |attribute, value| object.send(attribute.to_s+'=', value) }
  45 + object.assign_attributes(data, :without_protection => true)
46 46 object
47 47 end
48 48  
... ...