Sha256: 81ad2dc9ec7ad0e3312048b5e25762b90e89d30a59b336cd5b4c4ec5dde493ea

Contents?: true

Size: 1.36 KB

Versions: 19

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper'

describe ACTV::Article do
  context "shoulda matchers" do
    subject { ACTV::Article.new(assetGuid: 1) }

    it { should respond_to :summary }
    it { should respond_to :description }
    it { should respond_to :by_line }
    it { should respond_to :author_bio }
    it { should respond_to :author_photo }
    it { should respond_to :source }
    it { should respond_to :type }
    it { should respond_to :image }
    it { should respond_to :subtitle }
    it { should respond_to :footer }
    it { should respond_to :inline_ad }
    it { should respond_to :inline_ad? }
  end

  describe '#inline_ad?' do
    context 'if inlindead is set to true' do
      let(:article) { ACTV::Article.new(assetGuid: 1, assetTags: [ { tag: { tagId: '1', tagName: 'true', tagDescription: 'inlinead' } } ]) }
      it 'should return true' do
        article.inline_ad?.should eq true
      end
    end

    context 'if inlindead is set to false' do
      let(:article) { ACTV::Article.new(assetGuid: 1, assetTags: [ { tag: { tagId: '1', tagName: 'false', tagDescription: 'inlinead' } } ]) }
      it 'should return false' do
        article.inline_ad?.should eq false
      end
    end

    context 'if inlindead is not set' do
      let(:article) { ACTV::Article.new assetGuid: 1 }

      it 'should return true' do
        article.inline_ad?.should eq true
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
actv-1.3.11 spec/actv/article_spec.rb
actv-1.3.10 spec/actv/article_spec.rb
actv-1.3.9 spec/actv/article_spec.rb
actv-1.3.8 spec/actv/article_spec.rb
actv-1.3.7 spec/actv/article_spec.rb
actv-1.3.6 spec/actv/article_spec.rb
actv-1.3.5 spec/actv/article_spec.rb
actv-1.3.4 spec/actv/article_spec.rb
actv-1.3.3 spec/actv/article_spec.rb
actv-1.3.2 spec/actv/article_spec.rb
actv-1.3.0 spec/actv/article_spec.rb
actv-1.2.0 spec/actv/article_spec.rb
actv-1.1.23 spec/actv/article_spec.rb
actv-1.1.17 spec/actv/article_spec.rb
actv-1.1.6 spec/actv/article_spec.rb
actv-1.1.5 spec/actv/article_spec.rb
actv-1.1.3 spec/actv/article_spec.rb
actv-1.1.1 spec/actv/article_spec.rb
actv-1.1.0 spec/actv/article_spec.rb