Skip to content

Commit

Permalink
Add test case about assigning nil in enum
Browse files Browse the repository at this point in the history
This commit will be squished into f4fbdb1 after maintainer's review.
yhirano55 committed Dec 27, 2019
1 parent f4fbdb1 commit f5ec524
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions activerecord/test/cases/enum_test.rb
Original file line number Diff line number Diff line change
@@ -231,6 +231,11 @@ class EnumTest < ActiveRecord::TestCase
assert_nil @book.status
end

test "assign nil value to enum which defines nil value to hash" do
@book.read_status = nil
assert_equal "forgotten", @book.read_status
end

test "assign empty string value" do
@book.status = ""
assert_nil @book.status

0 comments on commit f5ec524

Please sign in to comment.