Changing add_product method to this passes without failure. I've
noticed before that I don't use urls with /show anymore -- therefore
eliminated it from the method. What I wanted to ask is: is this code
good enough? or am I missing something important?
TIA

def add_product(parameters)
      category = Category.find(:all).first

      get 'products/new'
      assert_response :success
      assert_template "products/new.html.erb"
      assert_tag :tag => 'option', :attributes => { :value =>
category.id }

      post 'products/create', parameters
      assert_response :redirect
      follow_redirect!
      assert_response :success
      assert_template "products/show.html.erb"
      return Product.find_by_title(parameters[:product][:title])
    end
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to