Sunday, 11 August 2013

undefined method `first_name=' for #User

undefined method `first_name=' for #User

I have model:
class User < ActiveRecord::Base
attr_accessible :login,
:password,
:email,
:first_name,
:middle_name,
:last_name,
:phone
end
but, I have a problem =>
undefined method `first_name=' for #<User:0xa604c30>
...
test/functional/users_controller_test.rb:5:in `block in
<class:UsersControllerTest>'
...
File with error test/functional/users_controller_test.rb
require 'test_helper'
class UsersControllerTest < ActionController::TestCase
setup do
@user = create :user
end
...
FactoryGirl file test/factories/users/rb
FactoryGirl.define do
factory :user do
login
password
first_name "MyString"
...
end
end

No comments:

Post a Comment