I am using Ruby on Rails 3.0.10, RSpec 2 and FactoryGirl. I am trying to validate user account data.
In my model I have:
class Users::Account < ActiveRecord::Base
...
def get_account_password_salt(password)
make_user_account_password_salt(password)
end
end
In my spec file I have
it "should have a valid password salt" do
users_account.password_salt.should == Users::Account.get_account_password_salt('123456')
end
When I run the rspec command I get the following error:
Users::Account should have a valid password salt
Failure/Error: users_account.password_salt.should == Users::Account.get_account_password_salt('123456')
NoMethodError:
undefined method `get_account_password_salt' for #<Class:0x0000010729c9f0>
What is the problem and how can I solve that?
I also tryed to use ::Users::Account.get_account_password_salt('123456') (note the :: at the beginning) but it still doesn’t work.
SOLUTION
The problem was that I have to run
instead of: