You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe Submodel
before(:all) do
Vehicle::Make.enumeration_model_updates_permitted = true
@make = Factory('vehicle/make')
end
it { should validate_presence_of :code }
it { should validate_uniqueness_of :code }
it { should validate_presence_of :name}
# NOTE: validation for :name column don't work when acts_as_enumerated is used
it { should validate_uniqueness_of :name}
end
When I run it I've got the 4th test failed (all other are passed):
1) Submodel validations
Failure/Error: it { should validate_uniqueness_of :name}
Expected errors to include "has already been taken" when name is set to "unique_string_5", got errors: code can't be blank (nil)name can't be blank (nil)
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-expectations-2.6.0/lib/rspec/expectations/fail_with.rb:29:in `fail_with'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-expectations-2.6.0/lib/rspec/expectations/handler.rb:21:in `handle_matcher'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-expectations-2.6.0/lib/rspec/expectations/extensions/kernel.rb:27:in `should'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/subject.rb:54:in `should'
# ./spec/models/submodel_spec.rb:29
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example.rb:48:in `instance_eval'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example.rb:48:in `run'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example.rb:107:in `with_around_hooks'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example.rb:45:in `run'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:294:in `run_examples'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:290:in `map'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:290:in `run_examples'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:262:in `run'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:263:in `run'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:263:in `map'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:263:in `run'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in `run'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in `map'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in `run'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/reporter.rb:12:in `report'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:21:in `run'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'
# ~/.rvm/gems/ree-1.8.7-2011.03@gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in `run'
The text was updated successfully, but these errors were encountered:
My env:
I've got the next model:
I've got the next RSpec test:
When I run it I've got the 4th test failed (all other are passed):
The text was updated successfully, but these errors were encountered: