2015-12-10 6 views
1

Я получаю undefined define_enum_for method error после обновления рельсов до 4.2.0 с 4.1.undefined method define_enum_for для RSpec :: Примеры групп

Есть ли какие-либо исправления для этого?

Рельсы: 4.2.0

Рубин: рубин 2.1.5p273 (2014-11-13 редакция 48405) [i686-Linux]

1) Recording 
    Failure/Error: 
     should define_enum_for(:state). 
     with({ 
      initial: 'initial', 
      running: 'running', 
      stopped: 'stopped' 
     }) 

    NoMethodError: 
     undefined method `define_enum_for' for #<RSpec::ExampleGroups::Recording:0x99a0ea8> 

shoulda-matchers#define_enum_for

ответ

0

задающие test_framework :rspec для Shoulda -matchers # эта проблема решена.

shoulda-matchers#configuration

Shoulda::Matchers.configure do |config| 
    config.integrate do |with| 
    with.test_framework :rspec 

    with.library :active_record 
    with.library :active_model 
    with.library :action_controller 
    end 
end