Sha256: cf6065ce63e3ba69967dcf11e215290bc2f0ef9def94988b32844f242dc3c9f5

Contents?: true

Size: 917 Bytes

Versions: 1

Compression:

Stored size: 917 Bytes

Contents

require 'spec_helper'

describe 'Fetcher::Microdata::UserComments::Facebook::Coercer' do 
  context 'the Coercer receives a valid comment' do
    before do
      @comment_ex = JSON.parse File.read "spec/comment.json"
      @comment = ::Fetcher::Microdata::UserComments::Facebook::Coercer.call @comment_ex
    end

    it "should initialize the id" do
      @comment[:id].should == @comment_ex["id"]
    end

    it "should initialize the creator" do
      @comment[:creator].should be_an_instance_of Fetcher::Microdata::PersonUser
    end

    it "should initialize the message" do
      @comment[:commentText].should == @comment_ex["message"]
    end

    it "should initialize the created time" do
      @comment[:commentTime].should == @comment_ex["created_time"]
    end

    it "should initialize the like count if there are likes" do
      @comment[:likes_count].should == @comment_ex["likes"]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fetcher-microdata-facebook-0.0.1 spec/fetcher/microdata/user_comments/facebook/coercer_spec.rb