mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
oops, 'format' is not a real enum
This commit is contained in:
parent
91f431972b
commit
3dfd1bab6a
1 changed files with 8 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue