Sha256: 99d92f552ff937a8719f996678ceef671213dc83b64f262e08e7f0c3f0f66461

Contents?: true

Size: 833 Bytes

Versions: 1

Compression:

Stored size: 833 Bytes

Contents

require 'spec_helper'
require 'ronin/db/software_vendor'

describe Ronin::DB::SoftwareVendor do
  it "must use the 'ronin_software_vendors' table" do
    expect(described_class.table_name).to eq('ronin_software_vendors')
  end

  let(:name) { 'TestCo' }

  describe "validations" do
    describe "name" do
      it "should require name attribute" do
        software_vendor = described_class.new
        expect(software_vendor).to_not be_valid
        expect(software_vendor.errors[:name]).to eq(
          ["can't be blank"]
        )

        software_vendor = described_class.new(name: name)
        expect(software_vendor).to be_valid
      end
    end
  end

  subject { described_class.new(name: name) }

  describe "#to_s" do
    it "should include the vendor name" do
      expect(subject.to_s).to eq(name)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ronin-db-activerecord-0.1.0.beta1 spec/software_vendor_spec.rb