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 raise wrong number of argument if the count of arguments is distinct of 2' do expect { Fetcher::Microdata::ArticleSmall.new "a", "b", "c" }.to raise_error 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