Sha256: 6d14641498f2882d550f1143bbec9604f32ef57981d56979b9900f7cf60b1c57

Contents?: true

Size: 704 Bytes

Versions: 1

Compression:

Stored size: 704 Bytes

Contents

require 'spec_helper'

describe ForeignKeyValidation::Collector do

  let(:user) { User.create }
  let(:other_user) { User.create }

  describe ".new" do

    subject { ForeignKeyValidation::Collector }

    it "initializes new validator" do
      expect(subject.new).to be_instance_of ForeignKeyValidation::Collector
    end

  end

  describe "#check!" do

    subject { ForeignKeyValidation::Collector }

    it "returns true for known class" do
      expect(subject.new(klass: Issue).check!).to be true
    end

    it "raises error for class without relations" do
      expect{subject.new(klass: Dummy).check!}.to raise_error(ForeignKeyValidation::Errors::NoReleationFoundError)
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreign_key_validation-1.1.2 spec/collector/base_spec.rb