Sha256: f5099dbba40d815c11e795cef0ed6edf28e14de17ce8a6726400ad8fd7a098ef

Contents?: true

Size: 864 Bytes

Versions: 1

Compression:

Stored size: 864 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{ PageRankr.ranks("slocourts.net", :alexa_us, :alexa_global) }
      
      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

1 entries across 1 versions & 1 rubygems

Version Path
PageRankr-2.0.1 spec/edge_cases_spec.rb