Sha256: 15a9f1d2818fed837beb13b32511e6a0d3019252d3d40fe48660bf2af4618d89

Contents?: true

Size: 1.89 KB

Versions: 3

Compression:

Stored size: 1.89 KB

Contents

require 'spec_helper'

describe Fetcher::Microdata::ArticleSmall do
  describe '.new' do
    it 'should set the _type to schema.org/Article/Small' do 
      article = Fetcher::Microdata::ArticleSmall.new @argument, @viewer
      article._type.should == "http://schema.org/Article/Small"
    end
  end

  it 'should inherit from Fetcher::Microdata' do 
    Fetcher::Microdata::ArticleSmall.superclass.should == Fetcher::Microdata
  end

  describe 'attributes' do
    before do 
      Fetcher::Microdata::ArticleSmall.any_instance.stub :coerce
    end

    it 'should set attribute additionalType' do
      Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
        .attributes.should have_key :additionalType
    end

    it 'should set attribute id' do
      Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
        .attributes.should have_key :id
    end

    it 'should set attribute articleBody' do
      Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
        .attributes.should have_key :articleBody
    end    

    it 'should set attribute author' do
      Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
        .attributes.should have_key :author
    end 

    it 'should set attribute viewer' do 
      Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
        .attributes.should have_key :viewer
    end

    it 'should set attribute dateCreated' do
      Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
        .attributes.should have_key :dateCreated
    end    

    it 'should set attribute provider' do
      Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
        .attributes.should have_key :provider
    end    

    it 'should set attribute url' do
      Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
        .attributes.should have_key :url
    end    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fetcher-microdata-0.0.3 spec/fetcher/microdata/article_small_spec.rb
fetcher-microdata-0.0.2 spec/fetcher/microdata/article_small_spec.rb
fetcher-microdata-0.0.1 spec/fetcher/microdata/article_small_spec.rb