Im Michael Hartl'ın RoR Eğitimi Bölüm 8'de ve bir sorunum var. RSpec için "kendi" yöntemi "undefined" olduğu için test başarısız oluyor. Benzer bir şeyle tanıştın mı? bir sebep ne olabilir? Ben burada RSpec için tanımlanmamış yöntem “Hartl's Ruby on Rails Eğitimi”
user_spec.rb dan benim test kodu ... herşeyi kontrol ve kitapta aynıdır adres: testler çalışandescribe User do
before { @user = User.new(name: "Example User", email: "[email protected]",
password: "foobar", password_confirmation: "foobar") }
subject { @user }
describe "remember token" do
before { @user.save }
its(:remember_token) { should_not be_blank }
end
...
...
sonuç, diyor: tanımsız yöntem `onun Sınıf (NoMethodError): RSpec :: ExampleGroups :: Kullanıcı :: RememberToken için
MBP:sample_app smi$ bundle exec rspec spec
/Users/smi/projects/sample_app/spec/models/user_spec.rb:12:in `block (2 levels) in <top (required)>': **undefined method `its' for RSpec::ExampleGroups::User::RememberToken:Class (NoMethodError)**
from /Users/smi/.rvm/gems/ruby-2.0.0-p594/gems/rspec-core-3.1.7/lib/rspec/core/example_group.rb:325:in `module_exec'
from /Users/smi/.rvm/gems/ruby-2.0.0-p594/gems/rspec-core-3.1.7/lib/rspec/core/example_group.rb:325:in `subclass'
from /Users/smi/.rvm/gems/ruby-2.0.0-p594/gems/rspec-core-3.1.7/lib/rspec/core/example_group.rb:219:in `block in define_example_group_method'
from /Users/smi/projects/sample_app/spec/models/user_spec.rb:10:in `block in <top (required)>'
from /Users/smi/.rvm/gems/ruby-2.0.0-p594/gems/rspec-core-3.1.7/lib/rspec/core/example_group.rb:325:in `module_exec'
from /Users/smi/.rvm/g.................