summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2018-11-22 17:35:28 +0800
committerMark Chao <mchao@gitlab.com>2019-01-15 17:10:30 +0800
commitd253440ed16118d9bae78773fe96ea53aa6537a4 (patch)
tree1266af59da82983c5f18d91497dcb5f04067507f /spec
parent2abbfda301cdb6f1360800b5db203b10debeaffa (diff)
downloadgitlab-ce-d253440ed16118d9bae78773fe96ea53aa6537a4.tar.gz
Add query method for id query
Diffstat (limited to 'spec')
-rw-r--r--spec/models/application_record_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/application_record_spec.rb b/spec/models/application_record_spec.rb
new file mode 100644
index 00000000000..68aed387bfc
--- /dev/null
+++ b/spec/models/application_record_spec.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe ApplicationRecord do
+ describe '#id_in' do
+ let(:records) { create_list(:user, 3) }
+
+ it 'returns records of the ids' do
+ expect(User.id_in(records.last(2).map(&:id))).to eq(records.last(2))
+ end
+ end
+end