Okay, let me fix something before I make a further fool of myself. This:
@nodename = Node.find_by_name("servername").id
Should be:
@nodename = Node.find_by_name("servername")
So that's fixed and I can definitely say that works.
Posting problem still exists, though. :(
On Tue, Aug 4, 2009 at 5:27 PM, rilindo foster<[email protected]> wrote:
> 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.
>
--
Rilindo Foster
AOL Instant Messenger: rilindo
Google Talk: [email protected]
Web Site: http://www.monzell.com
Primary: [email protected]
Secondary: [email protected]
"Rich bachelors should be heavily taxed. It is not fair that some men
should be happier than others. -- Oscar Wilde
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---