-
-
Save enebo/c542f4b58af7576826d9d0ca387ac8f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
system ~/work/rails/activerecord (v5.2.0) * 1303% ARCONFIG="/home/enebo/work/activerecord-jdbc-adapter/test/rails/config.yml" ARCONN="sqlite3" BUNDLE_GEMFILE="/home/enebo/work/activerecord-jdbc-adapter/Gemfile" EXCLUDE_DIR="/home/enebo/work/activerecord-jdbc-adapter/test/rails/excludes/sqlite3" /home/enebo/work/jruby/bin/jruby -I"/home/enebo/work/activerecord-jdbc-adapter/lib:/home/enebo/work/activerecord-jdbc-adapter/jdbc-sqlite3/lib:/home/enebo/work/activerecord-jdbc-adapter/test/rails:/home/enebo/work/activerecord-jdbc-adapter/../rails/activerecord/test" -C "/home/enebo/work/activerecord-jdbc-adapter/../rails/activerecord" -rbundler/setup -rminitest -rminitest/excludes -I"/home/enebo/work/jruby/lib/ruby/gems/shared/gems/rake-12.3.1/lib" "/home/enebo/work/jruby/lib/ruby/gems/shared/gems/rake-12.3.1/lib/rake/rake_test_loader.rb" "test/cases/finder_test.rb" "test/cases/ar_schema_test.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "cases/helper" | |
require "models/post" | |
require "models/author" | |
require "models/categorization" | |
require "models/comment" | |
require "models/company" | |
require "models/tagging" | |
require "models/topic" | |
require "models/reply" | |
require "models/rating" | |
require "models/entrant" | |
require "models/project" | |
require "models/developer" | |
require "models/computer" | |
require "models/customer" | |
require "models/toy" | |
require "models/matey" | |
require "models/dog" | |
require "models/car" | |
require "models/tyre" | |
class FinderTest < ActiveRecord::TestCase | |
fixtures :companies, :topics, :entrants, :developers, :developers_projects, :posts, :comments, :accounts, :authors, :author_addresses, :customers, :categories, :categorizations, :cars | |
def test_find_by_with_large_number | |
assert_nil Topic.find_by(id: "9999999999999999999999999999999") | |
end | |
def test_hash_condition_find_malformed | |
assert_raise(ActiveRecord::StatementInvalid) { | |
Company.where(id: 2, dhh: true).first | |
} | |
end | |
private | |
def table_with_custom_primary_key | |
yield(Class.new(Toy) do | |
def self.name | |
"MercedesCar" | |
end | |
end) | |
end | |
def assert_raises_with_message(exception_class, message, &block) | |
err = assert_raises(exception_class) { block.call } | |
assert_match message, err.message | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment