Hello all,
Am I using flash in the correct way ?
In the code below, ModelController#auto_link_preview sets up the flash with
an obejct (array of Model records).
In ModelControllerTest#testAutoLinkCommit I am trying to setup the flash to
test the post to ModelController#auto_link_commit...
but I''m getting this :
TypeError: cannot convert String into Integer
when flash is referenced in ModelControllerTest#testAutoLinkCommit.
Do you get it ?
Am I out of my mind ?
Thanks for help in advance,
Peter Fitzgibbons
class ModelController < ApplicationController
scaffold :model
model :model
def auto_link_preview
@project = Project.find(params[:id])
models = Model.find(:all,
:conditions=>"ProjectID=#{@project.ProjectID}",
:order=>"ModelCode")
flash[:models] = models
end
def auto_link_commit
models = flash[:models]
end
end
class ModelControllerTest < Test::Unit::TestCase
fixtures :company, :project, :model, :SalesCommunities, :SalesPlans
def setup
@controller = ModelController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
def testAutoLinkCommit
breakpoint
flash[:models_sales_plans] = modelssalesplans
post(:auto_link_commit )
end
end
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails