Displaying 1 result from an estimated 1 matches for "get_company".
2007 Nov 21
7
describe AddressesController, "handling GET /addresses" do
Hello,
I''m working with scaffold generated controller test code for handling GET
requests. Address is the model being tested. Address belongs_to Company,
Company has_many addresses.
In my addresses_controller I have:
before_filter :get_company
def index
@addresses = @company.addresses.find(:all)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @addresses }
end
end
private
def get_company
@company = Company.find_by_id(params[:company_id])
end
My controller spec cod...