Thanx luis to take interest in my query.
The above code is in my communities_controller.
Its inside the create action.
I want to pass the title of the called community in the url. Before
passing it to the database i m converting title as an url by using
parameterize method.
I wrote a test case for it as follows:
Community.stub(:new).with({'these' => 'params'}) { mock_community(:save
=> true) }
post :create, :community => {'these' => 'params'}
assigns(:community).should be(mock_community)
But it gives the following failure:
Failure/Error: post :create, :community => {'these' => 'params'}
undefined method `parameterize' for nil:NilClass
So help me in writing test case for it.
Ishit
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment