I have a model as follows:
class Greeting < ActiveRecord::Base
attr_accessible :headline, :icon, :content
belongs_to :user
accepts_nested_attributes_for :user, :reject_if => proc { |a| a[:name].blank? || a[:email].blank? }
How can I do an Rspec test for this?
I just found this shoulda macro, seems like it works fine:
https://gist.github.com/1353500/bae9d4514737a5cd7fa7315338fdd9053dbff543
you should use it like this:
it{ should accept_nested_attributes_for :samples }