diff options
Diffstat (limited to 'activerecord/test/cases/enum_test.rb')
-rw-r--r-- | activerecord/test/cases/enum_test.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/enum_test.rb b/activerecord/test/cases/enum_test.rb index ed1585da1a..43fca42478 100644 --- a/activerecord/test/cases/enum_test.rb +++ b/activerecord/test/cases/enum_test.rb @@ -33,12 +33,12 @@ class EnumTest < ActiveRecord::TestCase end test "find via where with symbols" do - assert_equal @book, Book.where(format: :paperback).first - refute_equal @book, Book.where(format: :ebook).first - assert_equal @book, Book.where(format: [:paperback]).first - refute_equal @book, Book.where(format: [:ebook]).first - refute_equal @book, Book.where("format <> ?", :paperback).first - assert_equal @book, Book.where("format <> ?", :ebook).first + assert_equal @book, Book.where(status: :proposed).first + refute_equal @book, Book.where(status: :written).first + assert_equal @book, Book.where(status: [:proposed]).first + refute_equal @book, Book.where(status: [:written]).first + refute_equal @book, Book.where("status <> ?", :proposed).first + assert_equal @book, Book.where("status <> ?", :written).first end test "find via where with strings" do @@ -46,8 +46,8 @@ class EnumTest < ActiveRecord::TestCase refute_equal @book, Book.where(status: "written").first assert_equal @book, Book.where(status: ["proposed"]).first refute_equal @book, Book.where(status: ["written"]).first - refute_equal @book, Book.where("format <> ?", "paperback").first - assert_equal @book, Book.where("format <> ?", "ebook").first + refute_equal @book, Book.where("status <> ?", "proposed").first + assert_equal @book, Book.where("status <> ?", "written").first end test "update by declaration" do |