aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relation/select_test.rb
diff options
context:
space:
mode:
authorMohsen Alizadeh <mohsen@alizadeh.us>2017-12-03 15:16:52 +0330
committerMohsen Alizadeh <mohsen@alizadeh.us>2017-12-03 15:16:52 +0330
commitccbba229386bdc629be5f5f4ef765ab5e29e7da7 (patch)
treea8eb2c2dc03e8f89d4167da55093e9d65164af50 /activerecord/test/cases/relation/select_test.rb
parent2dafbeed5e2afc001aa64ebf6363f350a6f259ac (diff)
downloadrails-ccbba229386bdc629be5f5f4ef765ab5e29e7da7.tar.gz
rails-ccbba229386bdc629be5f5f4ef765ab5e29e7da7.tar.bz2
rails-ccbba229386bdc629be5f5f4ef765ab5e29e7da7.zip
add test case to relation select
Diffstat (limited to 'activerecord/test/cases/relation/select_test.rb')
-rw-r--r--activerecord/test/cases/relation/select_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation/select_test.rb b/activerecord/test/cases/relation/select_test.rb
new file mode 100644
index 0000000000..0577e6bfdb
--- /dev/null
+++ b/activerecord/test/cases/relation/select_test.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+require "cases/helper"
+require "models/post"
+
+module ActiveRecord
+ class SelectTest < ActiveRecord::TestCase
+ fixtures :posts
+
+ def test_select_with_nil_agrument
+ expected = Post.select(:title).to_sql
+ assert_equal expected, Post.select(nil).select(:title).to_sql
+ end
+ end
+end