diff options
Diffstat (limited to 'spec/models/ci/build_metadata_spec.rb')
-rw-r--r-- | spec/models/ci/build_metadata_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/models/ci/build_metadata_spec.rb b/spec/models/ci/build_metadata_spec.rb index 16cff72db64..e728ce0f474 100644 --- a/spec/models/ci/build_metadata_spec.rb +++ b/spec/models/ci/build_metadata_spec.rb @@ -182,4 +182,36 @@ RSpec.describe Ci::BuildMetadata do end end end + + describe 'routing table switch' do + context 'with ff disabled' do + before do + stub_feature_flags(ci_partitioning_use_ci_builds_metadata_routing_table: false) + end + + it 'uses the legacy table' do + expect(described_class.table_name).to eq('ci_builds_metadata') + end + end + + context 'with ff enabled' do + before do + stub_feature_flags(ci_partitioning_use_ci_builds_metadata_routing_table: true) + end + + it 'uses the routing table' do + expect(described_class.table_name).to eq('p_ci_builds_metadata') + end + end + end + + context 'jsonb fields serialization' do + it 'changing other fields does not change config_options' do + expect { metadata.id = metadata.id }.not_to change(metadata, :changes) + end + + it 'accessing config_options does not change it' do + expect { metadata.config_options }.not_to change(metadata, :changes) + end + end end |