here is my rspec code:
describe User do
before{(@user=User.new(username:"abcdefg",email:"[email protected]",password:"123456")}
subject(@user)
@user.save
end
and I got such an error : undefined method 'save' for nil:NilClass(NoMethodError)
I try to write the same code in the rails console,it just worked. But when it comes to Rspec,it failed and I'm not able to find any reason...
Could any one help me with it?
@userpreviously in the same session