Sha256: 9e13038a2577193c45b745d2592690239d557eec576aa47e6f8a16ae4e069cf0

Contents?: true

Size: 787 Bytes

Versions: 59

Compression:

Stored size: 787 Bytes

Contents

require 'spec_helper'

describe ResourceTypesService do
  describe "select_options" do
    subject { described_class.select_options }

    it "has a select list" do
      expect(subject.first).to eq ["Article", "Article"]
      expect(subject.size).to eq 20
    end
  end

  describe "label" do
    subject { described_class.label("Video") }

    it { is_expected.to eq 'Video' }
  end

  describe "microdata_type" do
    subject { described_class.microdata_type(id) }

    context "when the id is in the i18n" do
      let(:id) { "Map or Cartographic Material" }
      it { is_expected.to eq 'http://schema.org/Map' }
    end

    context "when the id is not in the i18n" do
      let(:id) { "missing" }
      it { is_expected.to eq 'http://schema.org/CreativeWork' }
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.7.7 spec/search_builders/resource_types_service_spec.rb
curation_concerns-2.0.0 spec/search_builders/resource_types_service_spec.rb
curation_concerns-2.0.0.rc2 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.7.6 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.7.5 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.7.4 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.7.3 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.7.2 spec/search_builders/resource_types_service_spec.rb
curation_concerns-2.0.0.rc1 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.7.1 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.7.0 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.7.0.beta1 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.6.3 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.6.2 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.6.1 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.6.0 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.5.0 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.4.0 spec/search_builders/resource_types_service_spec.rb
curation_concerns-1.3.3 spec/search_builders/resource_types_service_spec.rb