Welcome to mirror list, hosted at ThFree Co, Russian Federation.

schema_addition_methods_no_post_spec.rb « migration « cop « rubocop « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fb087269e2dd16e64a7d973d4f5b7ba9675bdb7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

require 'rubocop_spec_helper'
require_relative '../../../../rubocop/cop/migration/schema_addition_methods_no_post'

RSpec.describe RuboCop::Cop::Migration::SchemaAdditionMethodsNoPost do
  before do
    allow(cop).to receive(:time_enforced?).and_return true
  end

  it "does not allow 'add_column' to be called" do
    expect_offense(<<~CODE)
      add_column
      ^^^^^^^^^^ #{described_class::MSG}
    CODE
  end

  it "does not allow 'create_table' to be called" do
    expect_offense(<<~CODE)
      create_table
      ^^^^^^^^^^^^ #{described_class::MSG}
    CODE
  end
end