aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorArthur Neves <arthurnn@gmail.com>2016-05-04 14:17:10 -0500
committerArthur Neves <arthurnn@gmail.com>2016-05-05 15:29:11 -0500
commitac1c4e141b20c1067af2c2703db6e1b463b985da (patch)
treeeed2088071412f3911aa9c573370e2f498ed85d5 /activerecord
parent79154a3281eb25a573dfcb5d5db31c3c481311f9 (diff)
downloadrails-ac1c4e141b20c1067af2c2703db6e1b463b985da.tar.gz
rails-ac1c4e141b20c1067af2c2703db6e1b463b985da.tar.bz2
rails-ac1c4e141b20c1067af2c2703db6e1b463b985da.zip
Add spec_id tests
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/connection_specification/resolver_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_specification/resolver_test.rb b/activerecord/test/cases/connection_specification/resolver_test.rb
index 358b6ad537..36d1e059c7 100644
--- a/activerecord/test/cases/connection_specification/resolver_test.rb
+++ b/activerecord/test/cases/connection_specification/resolver_test.rb
@@ -116,6 +116,15 @@ module ActiveRecord
"encoding" => "utf8" }, spec)
end
+ def test_spec_id_on_key_lookup
+ spec = spec(:readonly, 'readonly' => {'adapter' => 'sqlite3'})
+ assert_equal "readonly", spec.id
+ end
+
+ def test_spec_id_with_inline_config
+ spec = spec({'adapter' => 'sqlite3'})
+ assert_equal "primary", spec.id, "should default to primary id"
+ end
end
end
end