diff options
author | Sean McGivern <sean@gitlab.com> | 2019-04-24 17:08:20 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-04-24 17:08:20 +0300 |
commit | 5150802d0ab1b5a59637c86d6e82b747a126e12e (patch) | |
tree | 4cc5fa9428db91674fce33c990f4e6a23b0247e7 /spec | |
parent | 240db73c964286e6501cdb6c7b0df85a3d6db696 (diff) | |
parent | 9b752791624ce618810b9d65251582e56c37dee7 (diff) |
Merge branch 'sh-disable-internal-ids-available-check' into 'master'
Always use internal ID tables in development and production
Closes #60718
See merge request gitlab-org/gitlab-ce!27544
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/internal_id_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/models/internal_id_spec.rb b/spec/models/internal_id_spec.rb index 0ed4e146caa..806b4f61bd8 100644 --- a/spec/models/internal_id_spec.rb +++ b/spec/models/internal_id_spec.rb @@ -93,7 +93,7 @@ describe InternalId do before do described_class.reset_column_information # Project factory will also call the current_version - expect(ActiveRecord::Migrator).to receive(:current_version).twice.and_return(InternalId::REQUIRED_SCHEMA_VERSION - 1) + expect(ActiveRecord::Migrator).to receive(:current_version).at_least(:once).and_return(InternalId::REQUIRED_SCHEMA_VERSION - 1) end let(:init) { double('block') } @@ -104,6 +104,15 @@ describe InternalId do expect(init).to receive(:call).with(issue).and_return(val) expect(subject).to eq(val + 1) end + + it 'always attempts to generate internal IDs in production mode' do + allow(Rails.env).to receive(:test?).and_return(false) + val = rand(1..100) + generator = double(generate: val) + expect(InternalId::InternalIdGenerator).to receive(:new).and_return(generator) + + expect(subject).to eq(val) + end end end |