From 3dfd1bab6a523061e41fb89be51f149968eea510 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Fri, 13 Feb 2015 16:40:43 -0800 Subject: oops, 'format' is not a real enum --- activerecord/test/cases/enum_test.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'activerecord') 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 -- cgit v1.2.3