Sha256: 1ec2fd21fc97e9a419a0f93fa64c48c5d697ebf3a35774040549010e5f6852f5

Contents?: true

Size: 983 Bytes

Versions: 4

Compression:

Stored size: 983 Bytes

Contents

require 'spec_helper'

describe PageRankr do
  describe "#ranks" do
    # Alexa may sometimes return a result for the incorrect site and thus it is necessary to check if
    # the results returned are for the site we want.
    #
    # For example, slocourts.net returns results for ca.gov, presumably because www.slocourts.ca.gov redirects
    # to slocourts.net. Clearly something is wrong with how Alexa handles this case and so in the event this
    # happens we treat the results as if there were no results.
    describe "when Alexa returns results for the incorrect site" do
      subject do
        VCR.use_cassette(:alexa_ranks_edge_case_1, :record => :new_episodes) do
          PageRankr.ranks("http://slocourts.net", :alexa_us, :alexa_global)
        end
      end
      
      it{ should have_key(:alexa_us) }
      it{ should have_key(:alexa_global) }
      
      it{ subject[:alexa_us].should be_nil }
      it{ subject[:alexa_global].should be_nil }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
PageRankr-4.0.0 spec/edge_cases_spec.rb
PageRankr-3.2.1 spec/edge_cases_spec.rb
PageRankr-3.2.0 spec/edge_cases_spec.rb
PageRankr-3.1.2 spec/edge_cases_spec.rb