blob: 0012b8a0b96f79af4f125b8e9cef9c38f7d42b1c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe AddUpvotesCountIndexToIssues, feature_category: :team_planning do
let(:migration_instance) { described_class.new }
describe '#up' do
it 'adds index' do
expect { migrate! }.to change { migration_instance.index_exists?(:issues, [:project_id, :upvotes_count], name: described_class::INDEX_NAME) }.from(false).to(true)
end
end
describe '#down' do
it 'removes index' do
migrate!
expect { schema_migrate_down! }.to change { migration_instance.index_exists?(:issues, [:project_id, :upvotes_count], name: described_class::INDEX_NAME) }.from(true).to(false)
end
end
end
|