Skip to content

Commit

Permalink
Fix broken tests on Rails 7.1.2.
Browse files Browse the repository at this point in the history
The behavior of non-column-backed attributes for `enum` was
changed by rails/rails#49769.
  • Loading branch information
y-yagi committed Nov 24, 2023
1 parent 666ef70 commit 9fb8020
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -124,7 +124,7 @@

it "should raise an error for transitions" do
if ActiveRecord.gem_version >= Gem::Version.new('7.1.0')
expect{multiple_with_enum_without_column.send(:view, :left)}.to raise_error(RuntimeError, /Unknown enum attribute 'status'/)
expect{multiple_with_enum_without_column.send(:view, :left)}.to raise_error(RuntimeError, /Undeclared attribute type for enum 'status'/)
else
expect{multiple_with_enum_without_column.send(:view, :left)}.to raise_error(NoMethodError, /undefined method .status./)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/persistence/active_record_persistence_spec.rb
Expand Up @@ -124,7 +124,7 @@

it "should raise an error for transitions" do
if ActiveRecord.gem_version >= Gem::Version.new('7.1.0')
expect{with_enum_without_column.send(:view)}.to raise_error(RuntimeError, /Unknown enum attribute 'status'/)
expect{with_enum_without_column.send(:view)}.to raise_error(RuntimeError, /Undeclared attribute type for enum 'status'/)
else
expect{with_enum_without_column.send(:view)}.to raise_error(NoMethodError, /undefined method .status./)
end
Expand Down

0 comments on commit 9fb8020

Please sign in to comment.