Sha256: e6e879e75eb5894a5fdbb08245f0a1065013f2ebf11526256bde49bcc09fc0b7

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe "suggest_markup" do
  before(:each) do
    stub_zemanta_full!
  end

  let(:markup) { Zemanta.new("some text").suggest_markup }
  
  it "responds to #text" do
    markup.text.should == "text"
  end

  it "responds to #links" do
    markup.links.should be_a Array
  end

  describe ".links.first" do
    let(:link) { markup.links.first }

    it "responds to #relevance" do
      link.relevance.should == 0.8093
    end

    it "responds to #confidence" do
      link.confidence.should == 0.873863
    end

    it "responds to #entity_type" do
      link.entity_type.should == ["/location/location"]
    end

    it "responds to #target" do
      link.target.should be_a Array
    end

    it "responds to #anchor" do
      link.anchor.should == "Tiger Leaping Gorge"
    end

    describe ".target.first" do
      let(:target) { link.target.first }

      it "answers to #url" do
        target.url.should == "www.this.is.an/url"
      end

      it "answers to #type" do
        target.type.should == "geolocation"
      end

      it "answers to #title" do
        target.title.should == "Tiger Leaping Gorge"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zemanta_client-0.0.2 spec/zemanta/integration/correct_response_spec.rb
zemanta_client-0.0.1 spec/zemanta/integration/correct_response_spec.rb