Skip to content

Instantly share code, notes, and snippets.

@workmad3
Forked from anonymous/gist:562361
Created September 2, 2010 14:35
Show Gist options
  • Save workmad3/562372 to your computer and use it in GitHub Desktop.
Save workmad3/562372 to your computer and use it in GitHub Desktop.
it "should call the callback :before_add" do
@callback = lambda {true}
@record.class.has_and_belongs_to_many_active_resource :resourcen, :before_add => @callback
@record.resource_ids = [1]
@callback.should_receive(:call)
@record.add_resource(5)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment