Welcome to mirror list, hosted at ThFree Co, Russian Federation.

database_reflection_spec.rb « concerns « models « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4111f29ea8d73a5b54ca123babf2d8f166262d51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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