diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/models/internal_id_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/models/internal_id_spec.rb')
-rw-r--r-- | spec/models/internal_id_spec.rb | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/spec/models/internal_id_spec.rb b/spec/models/internal_id_spec.rb index 33d03bfc0f5..0dfb59cf43a 100644 --- a/spec/models/internal_id_spec.rb +++ b/spec/models/internal_id_spec.rb @@ -88,33 +88,6 @@ describe InternalId do expect(normalized).to eq((0..seq.size - 1).to_a) end - - context 'with an insufficient schema version' do - before do - described_class.reset_column_information - # Project factory will also call the current_version - expect(ActiveRecord::Migrator).to receive(:current_version).at_least(:once).and_return(InternalId::REQUIRED_SCHEMA_VERSION - 1) - end - - let(:init) { double('block') } - - it 'calculates next internal ids on the fly' do - val = rand(1..100) - - 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 - stub_rails_env('production') - - 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 describe '.reset' do @@ -152,20 +125,6 @@ describe InternalId do described_class.generate_next(issue, scope, usage, init) end end - - context 'with an insufficient schema version' do - let(:value) { 2 } - - before do - described_class.reset_column_information - # Project factory will also call the current_version - expect(ActiveRecord::Migrator).to receive(:current_version).at_least(:once).and_return(InternalId::REQUIRED_SCHEMA_VERSION - 1) - end - - it 'does not reset any of the iids' do - expect(subject).to be_falsey - end - end end describe '.track_greatest' do |