O
OnRails Ruby
Hi, everybody!
I got a strange question when I did a controller test as below
On controller.rb:
def send_welcome_message(person)
some codes;
end
there 'person' is instance variables.
the controller_test.rb:
def test_send_welcome_message
post :send_welcome_message, erson=>{:id=>'2',
:name=>'somebody'}
assert_response :success
end
when I run this test, There always said,
1) Error:
test_send_welcome_message(TestControllerTest):
ArgumentError: wrong number of arguments (0 for 1)
I know there maybe params are set wrong,
but how can I fix it out? please help, Thanks!
I got a strange question when I did a controller test as below
On controller.rb:
def send_welcome_message(person)
some codes;
end
there 'person' is instance variables.
the controller_test.rb:
def test_send_welcome_message
post :send_welcome_message, erson=>{:id=>'2',
:name=>'somebody'}
assert_response :success
end
when I run this test, There always said,
1) Error:
test_send_welcome_message(TestControllerTest):
ArgumentError: wrong number of arguments (0 for 1)
I know there maybe params are set wrong,
but how can I fix it out? please help, Thanks!