Permalink
Browse files

Fixing more tests

  • Loading branch information...
1 parent 85a00a5 commit 60c9895ff7940bd8aff07d3c442b7afb4263f37f @beerlington beerlington committed Feb 8, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/classy_enum/active_record.rb
  2. +1 −1 spec/classy_enum/active_record_spec.rb
View
2 lib/classy_enum/active_record.rb
@@ -33,7 +33,7 @@ def classy_enum_attr(attribute, options={})
serialize_as_json = options[:serialize_as_json] || false
default = options[:default]
- if default.present? && !default.in?(enum)
+ if default.present? && !enum.include?(default)
raise InvalidDefault, "must be one of [#{enum.to_a.join(',')}]"
end
View
2 spec/classy_enum/active_record_spec.rb
@@ -170,7 +170,7 @@ class DefaultValueDog < Dog
describe Dog, 'with invalid default value' do
it 'raises error with invalid default' do
expect {
- Class.new(Dog) { classy_enum_attr :breed, default: :nope }
+ Class.new(Dog) { classy_enum_attr :breed, :default => :nope }
}.to raise_error(ClassyEnum::InvalidDefault)
end
end

0 comments on commit 60c9895

Please sign in to comment.