debian-mirror-gitlab/spec/models/concerns/database_reflection_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
405 B
Ruby
Raw Normal View History

2021-12-11 22:18:48 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe DatabaseReflection do
describe '.reflect' do
it 'returns a Reflection instance' do
expect(User.database).to be_an_instance_of(Gitlab::Database::Reflection)
end
it 'memoizes the result' do
instance1 = User.database
instance2 = User.database
expect(instance1).to equal(instance2)
end
end
end