Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 4 未定义的方法'allow#u value';_Ruby On Rails 4_Rspec Rails - Fatal编程技术网

Ruby on rails 4 未定义的方法'allow#u value';

Ruby on rails 4 未定义的方法'allow#u value';,ruby-on-rails-4,rspec-rails,Ruby On Rails 4,Rspec Rails,在gem'rails'、'4.1.0.rc2'上的gem'shoulda matchers'有问题,当我运行测试时,我得到一个错误 /Volumes/Khaya/myapp/spec/models/account_spec.rb:13:in `block (2 levels) in <top (required)>': undefined method `allow_value' for RSpec::ExampleGroups::Account_2::Validations:Cla

在gem'rails'、'4.1.0.rc2'上的gem'shoulda matchers'有问题,当我运行测试时,我得到一个错误

/Volumes/Khaya/myapp/spec/models/account_spec.rb:13:in `block (2 levels) in <top (required)>': undefined method `allow_value' for RSpec::ExampleGroups::Account_2::Validations:Class (NoMethodError)
我的测试

it {should allow_value('vezu').for(:name)}

我想不出怎么解决这个问题。我的配置中是否缺少某些内容

我的错误我犯了这样的错误

it should_not allow_value('VEZU S').for(:name)
而不是

it {should_not allow_value('VEZU S').for(:name)}
it {should_not allow_value('VEZU S').for(:name)}