# Ensure that the model accepts nested attributes for association # # Example: # should_accept_nested_attributes_for :orders # def should_accept_nested_attributes_for(*associations) klass = model_class associations.each do |association| should "accept nested attributes for #{association}" do assert klass.new.respond_to?("#{association}_attributes="), "#{klass} does not accept nested attributes for association: #{association}" end end end