Hi! I am trying to get the hang of perform integration testing and I
have a slight problem with posting.

Basically, I can pull the id like so:

@nodename = Node.find_by_name("servername").id

Then able to get a valid 200 message with:

get "/nodes/#[email protected]}/edit"
assert_equal 200, status

But when I attempted to post:

post "/nodes/#[email protected]}/edit", :node => {:datacenter =>"someplace",
                                   :name => "servername",
                                   :application => "appname" }

I either get a 404 message or 422 message (usually 404) after
executing assert_equal 200, status:

  1) Failure:
test_edit_node(NodesTest) [/test/integration/nodes_test.rb:43]:
<200> expected but was
<404>

I thought it was a redirect problem, so I tried assert_redirected_to
"/nodes/#[email protected]}". I get:

  1) Failure:
test_edit_node(NodesTest) [/test/integration/nodes_test.rb:41]:
Expected response to be a <:redirect>, but was <404>

I am missing something here. A pointer to the right direction would be
helpful at the moment.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to