Sha256: 6c3d5d2be15fadbbbe9ef0b75ed660b596c50d70f5ae1ceaf6d0a5a3093abef3

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe 'Fetcher::Microdata::PersonUser::Twitter::Coercer' do 
  context 'a valid twitter user hash is passed' do 
    before do 
      @user = JSON.parse File.read 'spec/user.json'
      @result = ::Fetcher::Microdata::PersonUser::Twitter::Coercer.call @user
    end

    it 'should initialize the additionalType as getfetcher.net/Item' do 
      @result[:additionalType].should == "http://getfetcher.net/Item"
    end

    it 'should assign to :id the "id"' do 
      @result[:id].should == @user["id"]
    end

    it 'should assign to :name the "name"' do 
      @result[:name].should == @user["name"]
    end
    
    it 'should assign to :dateRegistered the timestamp corresponding to "created_at"' do 
      @result[:dateRegistered].should == 1249685355
    end      

    it 'should assign to :description the "description"' do 
      @result[:description].should == @user["description"]
    end         

    it 'should assign to :url the "screen_name" after the twitter url' do 
      @result[:url].should == "https://twitter.com/#{@user["screen_name"]}"
    end               
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fetcher-microdata-twitter-0.0.6 spec/fetcher/microdata/person_user/twitter/coercer_spec.rb
fetcher-microdata-twitter-0.0.5 spec/fetcher/microdata/person_user/twitter/coercer_spec.rb
fetcher-microdata-twitter-0.0.3 spec/fetcher/microdata/person_user/twitter/coercer_spec.rb