Sha256: 81dd6d456d3d7b5d6d4a80a7652203abfd68dcb808c9ddb6ec4257c85de4bb16

Contents?: true

Size: 1.36 KB

Versions: 31

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper'

describe ACTV::AssetFactory do
  let(:category_name) { "" }
  let(:category_taxonomy) { "" }
  let(:response) { {assetGuid: "111",
                    assetCategories: [{category: {categoryName: category_name,
                                                  categoryTaxonomy: category_taxonomy}}]} }
  subject(:asset) { ACTV::AssetFactory.new(response).asset }

  describe '#asset' do
    context 'the response is not an author, event or article' do
      it { should be_a ACTV::Asset }
    end
    context 'the response has an article category' do
      let(:category_name) { "Articles" }
      it { should be_a ACTV::Article }
    end
    context 'the response has an article taxonomy' do
      let(:category_taxonomy) { "Running/Articles" }
      it { should be_a ACTV::Article }
    end
    context 'the response has an event category' do
      let(:category_name) { "Event" }
      it { should be_a ACTV::Event }
    end
    context 'the response has an event taxonomy' do
      let(:category_taxonomy) { "Race/Event" }
      it { should be_a ACTV::Event }
    end
    context 'the response has an author category' do
      let(:category_name) { "Author" }
      it { should be_a ACTV::Author }
    end
    context 'the response has an author taxonomy' do
      let(:category_taxonomy) { "Running/Author" }
      it { should be_a ACTV::Author }
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
actv-2.10.9 spec/actv/asset_factory_spec.rb
actv-2.10.8 spec/actv/asset_factory_spec.rb
actv-2.10.7 spec/actv/asset_factory_spec.rb
actv-2.10.6 spec/actv/asset_factory_spec.rb
actv-2.10.5 spec/actv/asset_factory_spec.rb
actv-2.10.4 spec/actv/asset_factory_spec.rb
actv-2.10.3 spec/actv/asset_factory_spec.rb
actv-2.10.2 spec/actv/asset_factory_spec.rb
actv-2.10.1 spec/actv/asset_factory_spec.rb
actv-2.10.0 spec/actv/asset_factory_spec.rb
actv-2.9.2 spec/actv/asset_factory_spec.rb
actv-2.9.1 spec/actv/asset_factory_spec.rb
actv-2.9.0 spec/actv/asset_factory_spec.rb
actv-2.8.2 spec/actv/asset_factory_spec.rb
actv-2.8.1 spec/actv/asset_factory_spec.rb
actv-2.7.0 spec/actv/asset_factory_spec.rb
actv-2.6.0 spec/actv/asset_factory_spec.rb
actv-2.5.2 spec/actv/asset_factory_spec.rb
actv-2.5.1 spec/actv/asset_factory_spec.rb
actv-2.5.0 spec/actv/asset_factory_spec.rb