<commit_before>require 'spec_helper'

describe Mdm::Module::Relationship do
  context 'associations' do
    it { should belong_to(:ancestor).class_name('Mdm::Module::Ancestor') }
    it { should belong_to(:descendant).class_name('Mdm::Module::Class') }
  end

  context 'database' do
    context 'columns' do
      it { should have_db_column(:ancestor_id).of_type(:integer).with_options(:null => false) }
      it { should have_db_column(:descendant_id).of_type(:integer).with_options(:null => false) }
    end

    context 'indices' do
      it { should have_db_index([:ancestor_id, :descendant_id]).unique(true) }
    end
  end

  context 'factories' do
    context 'mdm_module_relationship' do
      subject(:mdm_module_relationship) do
        FactoryGirl.build(:mdm_module_relationship)
      end

      it { should be_valid }
    end<commit_msg>Fix order of index in Mdm::Module::Relationship spec<commit_after>require 'spec_helper'

describe Mdm::Module::Relationship do
  context 'associations' do
    it { should belong_to(:ancestor).class_name('Mdm::Module::Ancestor') }
    it { should belong_to(:descendant).class_name('Mdm::Module::Class') }
  end

  context 'database' do
    context 'columns' do
      it { should have_db_column(:ancestor_id).of_type(:integer).with_options(:null => false) }
      it { should have_db_column(:descendant_id).of_type(:integer).with_options(:null => false) }
    end

    context 'indices' do
      it { should have_db_index([:descendant_id, :ancestor_id]).unique(true) }
    end
  end

  context 'factories' do
    context 'mdm_module_relationship' do
      subject(:mdm_module_relationship) do
        FactoryGirl.build(:mdm_module_relationship)
      end

      it { should be_valid }
    end
{'fraction_non_alphanumeric': 0.11717403790924756, 'fraction_numerical': 0.0, 'mean_word_length': 4.169139465875371, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4547415', 'n_tokens_mistral': 573, 'n_tokens_neox': 554, 'n_words': 111}