`test': wrong number of arguments (1 for 2) (ArgumentError)

Hi,

Im trying to change the syntax of my tests to the

test “some method” do
…
end

syntax from the existing

def test_some_method
…
end

syntax. Im pasting my test code below. Im getting the error in the
subject line if I try to run the test as a ruby script from the
console.

require File.dirname(FILE) + ‘/…/test_helper’
require ‘accounts_controller’

class AccountsController; def rescue_action(e) raise e end; end

class AccountsControllerTest < ActionController::TestCase

fixtures :accounts

def setup
@controller = AccountsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end

test “should allow signup” do
assert_difference ‘Account.count’ do
create_account
assert_response :redirect
end
end

protected
def create_account(options = {})
post :create, :account => { :name => ‘who’, :email =>
‘[email protected]’,
:password => ‘who’, :password_confirmation =>
‘who’ }.merge(options)
end
end

Am I missing something here? Im running Rails 2.1.0 .

On Apr 5, 12:40 pm, Ram [email protected] wrote:

Hi,

Im trying to change the syntax of my tests to the

test “some method” do
…
end

[snip]

Am I missing something here? Im running Rails 2.1.0 .

That feature was only added after rails 2.1 if my memory is correct.

Fred