|
@ -266,7 +266,7 @@ describe ApplicationController, type: :controller do |
|
|
shared_examples 'receives :with_includes' do |fabricator, klass| |
|
|
shared_examples 'receives :with_includes' do |fabricator, klass| |
|
|
it 'uses raw if it is not an ActiveRecord::Relation' do |
|
|
it 'uses raw if it is not an ActiveRecord::Relation' do |
|
|
record = Fabricate(fabricator) |
|
|
record = Fabricate(fabricator) |
|
|
expect(C.new.cache_collection([record], klass)).to match_array([record]) |
|
|
|
|
|
|
|
|
expect(C.new.cache_collection([record], klass)).to eq [record] |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
@ -277,7 +277,7 @@ describe ApplicationController, type: :controller do |
|
|
record = Fabricate(fabricator) |
|
|
record = Fabricate(fabricator) |
|
|
relation = klass.none |
|
|
relation = klass.none |
|
|
allow(relation).to receive(:cache_ids).and_return([record]) |
|
|
allow(relation).to receive(:cache_ids).and_return([record]) |
|
|
expect(C.new.cache_collection(relation, klass)).to match_array([record]) |
|
|
|
|
|
|
|
|
expect(C.new.cache_collection(relation, klass)).to eq [record] |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|