Sha256: 14b9f893fe43b15bb17a8349e88edab9c3caa39e09780ecb6d4c084ff7491f42

Contents?: true

Size: 1.58 KB

Versions: 3

Compression:

Stored size: 1.58 KB

Contents

require 'spec_helper'

describe Fetcher::Microdata::UserComments do
  describe '.new' do
    it 'should set the _type to schema.org/UserComments' do 
      @arg = stub "arg"
      article = Fetcher::Microdata::UserComments.new @arg, @argument
      article._type.should == "http://schema.org/UserComments"
    end
  end

  it 'should raise wrong number of argument if the count of arguments is distinct of 2' do
    expect {
      Fetcher::Microdata::UserComments.new "a", "b", "c", "d"
    }.to raise_error
  end

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

  describe 'attributes' do
    before do 
      @arg1 = stub "args1"
      @arg2 = stub "args2"
      Fetcher::Microdata::UserComments.any_instance.stub :coerce
    end

    it 'should set attribute additionalType' do
      Fetcher::Microdata::UserComments.new(@arg1, @arg2)
        .attributes.should have_key :additionalType
    end

    it 'should set attribute id' do
      Fetcher::Microdata::UserComments.new(@arg1, @arg2)
        .attributes.should have_key :id
    end

    it 'should set attribute commentText' do
      Fetcher::Microdata::UserComments.new(@arg1, @arg2)
        .attributes.should have_key :commentText
    end    

    it 'should set attribute creator' do
      Fetcher::Microdata::UserComments.new(@arg1, @arg2)
        .attributes.should have_key :creator
    end    

    it 'should set attribute commentTime' do
      Fetcher::Microdata::UserComments.new(@arg1, @arg2)
        .attributes.should have_key :commentTime
    end   
  
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fetcher-microdata-0.0.13 spec/fetcher/microdata/user_comments_spec.rb
fetcher-microdata-0.0.12 spec/fetcher/microdata/user_comments_spec.rb
fetcher-microdata-0.0.11 spec/fetcher/microdata/user_comments_spec.rb