Skip to content

Commit

Permalink
Add failing spec for #318
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Jul 24, 2024
1 parent 8e5794b commit 3591ab2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec/chrono_model/adapter/migrations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,30 @@
end
end

describe '.add_reference' do
with_temporal_table do
before do
adapter.add_reference table, :foo
end

it { is_expected.to have_temporal_index 'index_test_table_on_foo_id', %w[foo_id] }
it { is_expected.to have_history_index 'index_test_table_on_foo_id', %w[foo_id] }
end
end

describe '.references' do
with_temporal_table do
before do
adapter.create_table table, force: true, temporal: true do |t|
t.references :foo
end
end

it { is_expected.to have_temporal_index 'index_test_table_on_foo_id', %w[foo_id] }
it { is_expected.to have_history_index 'index_test_table_on_foo_id', %w[foo_id] }
end
end

describe '.add_index' do
with_temporal_table do
before do
Expand Down

0 comments on commit 3591ab2

Please sign in to comment.