Skip to content

Commit

Permalink
Add failing spec for #318
Browse files Browse the repository at this point in the history
tagliala committed Jul 26, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tagliala Geremia Taglialatela
1 parent 8e5794b commit ed4a7e7
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions spec/chrono_model/adapter/migrations_spec.rb
Original file line number Diff line number Diff line change
@@ -215,6 +215,38 @@
end
end

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

it { is_expected.to have_columns([%w[foo_id bigint]]) }
it { is_expected.to have_temporal_columns([%w[foo_id bigint]]) }
it { is_expected.to have_history_columns([%w[foo_id bigint]]) }

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_columns([%w[foo_id bigint]]) }
it { is_expected.to have_temporal_columns([%w[foo_id bigint]]) }
it { is_expected.to have_history_columns([%w[foo_id bigint]]) }

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

0 comments on commit ed4a7e7

Please sign in to comment.