Sha256: b392840ebf9651f56fbf08357ec5078247630b6451c78bcd95a0682e976b9e44

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 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["text"]
    end

    it "should initialize the created time" do
      @comment[:commentTime].should == "#{@comment_ex["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

2 entries across 2 versions & 1 rubygems

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