diff options
author | Mark Chao <mchao@gitlab.com> | 2018-11-22 12:35:28 +0300 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2019-01-15 12:10:30 +0300 |
commit | d253440ed16118d9bae78773fe96ea53aa6537a4 (patch) | |
tree | 1266af59da82983c5f18d91497dcb5f04067507f /spec/models/application_record_spec.rb | |
parent | 2abbfda301cdb6f1360800b5db203b10debeaffa (diff) |
Add query method for id query
Diffstat (limited to 'spec/models/application_record_spec.rb')
-rw-r--r-- | spec/models/application_record_spec.rb | 13 |
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 |