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

column_spec.rb « schema_objects « schema_validation « database « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 74bc5f43b5057a69eea6c2faacdb2263ce4b4627 (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
25
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Database::SchemaValidation::SchemaObjects::Column, feature_category: :database do
  subject(:column) { described_class.new(adapter) }

  let(:database_adapter) { 'Gitlab::Database::SchemaValidation::Adapters::ColumnDatabaseAdapter' }
  let(:adapter) do
    instance_double(database_adapter, name: 'id', table_name: 'projects',
      data_type: 'bigint', default: nil, nullable: 'NOT NULL')
  end

  describe '#name' do
    it { expect(column.name).to eq('id') }
  end

  describe '#table_name' do
    it { expect(column.table_name).to eq('projects') }
  end

  describe '#statement' do
    it { expect(column.statement).to eq('id bigint NOT NULL') }
  end
end