Sha256: e307983ebf7b30c85f6b94e07c2693ab96c76fb68e3a09910cfc1e460fc3af42

Contents?: true

Size: 668 Bytes

Versions: 4

Compression:

Stored size: 668 Bytes

Contents

require 'rails_helper'

RSpec.describe TaxonomyItem, type: :model do
  it 'should have some items' do
    expect(TaxonomyItem.count).to eq(912)
  end

  it 'should filter by depth' do
    expect(TaxonomyItem.provider_types.count).to eq(29)
    expect(TaxonomyItem.specialties.count).to eq(244)
    expect(TaxonomyItem.sub_specialties.count).to eq(611)
  end

  it 'should be categorized' do
    expect(TaxonomyItem.categorized.count).to be > 0
  end

  it 'should have parents' do
    dental_prov = TaxonomyItem.where(name: 'Dental Providers').first
    dentist = TaxonomyItem.where(name: 'Dentist').first
    expect(dentist.parent_id).to eq(dental_prov.id)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
provider_taxonomy-0.1.7 spec/models/taxonomy_item_spec.rb
provider_taxonomy-0.1.6 spec/models/taxonomy_item_spec.rb
provider_taxonomy-0.1.5 spec/models/taxonomy_item_spec.rb
provider_taxonomy-0.1.4 spec/models/taxonomy_item_spec.rb