24 行
981 B
Ruby
24 行
981 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe 'Schema after Wiki removal' do
|
|
it 'has no legacy Wiki tables or name indirection columns' do
|
|
connection = ApplicationRecord.connection
|
|
['wiki_pages', 'wiki_revisions', 'wiki_lines', 'wiki_revision_lines', 'wiki_versions']
|
|
.each do |table|
|
|
expect(connection.table_exists?(table)).to be(false)
|
|
end
|
|
expect(connection.column_exists?(:tags, :tag_name_id)).to be(false)
|
|
expect(connection.column_exists?(:tag_names, :canonical_id)).to be(false)
|
|
end
|
|
|
|
it 'requires TagName ownership while keeping the native resources and history' do
|
|
connection = ApplicationRecord.connection
|
|
expect(TagName.columns_hash.fetch('tag_id').null).to be(false)
|
|
expect(connection.foreign_key_exists?(:tag_names, :tags)).to be(true)
|
|
['tag_descriptions', 'tag_description_versions', 'tag_groups', 'tag_group_versions']
|
|
.each do |table|
|
|
expect(connection.table_exists?(table)).to be(true)
|
|
end
|
|
end
|
|
end
|