Sha256: 32fa5292ab2bd538d0c52b11af578800a72b5ab46b39c78df1cdb6b8c608856a

Contents?: true

Size: 1.55 KB

Versions: 18

Compression:

Stored size: 1.55 KB

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe MajesticSeo::Api::TopBackLinksResponse  do

  describe "invalid response from MajesticSeo" do
    before(:each) do
	    @xml        =   '<?xml version="1.0" encoding="utf-8"?><Result Code="FailedRequestViaAPI" ErrorMessage="API Key does not appear to be correct: API_KEY - &#39;api_key&#39;" FullError="Majestic12.SearchIndexReportResponse+ResponseException: API Key does not appear to be correct: API_KEY - &#39;api_key&#39;&#13;&#10;   at Majestic12.SearchIndexReportManager.Authenticate(SearchIndexReportRequest oReq) in W:\VersionFiles\WorldSource\MJ12searchLib\SearchIndexReportManager.cs:line 2411&#13;&#10;   at Majestic12.SearchIndexReportManager.RunReport(SearchConfig oConfig, SearchIndex oSI, SearchIndexReportRequest oReq, Boolean bAvoidQueueing, SearchIndexReportResponse&#38; oRes) in W:\VersionFiles\WorldSource\MJ12searchLib\SearchIndexReportManager.cs:line 2071"><GlobalVars/></Result>'
      @parsed     =   ::Nokogiri::XML(@xml, nil, "utf-8")
      @response   =   MajesticSeo::Api::TopBackLinksResponse.new(@parsed)
      @table      =   @response.tables["URL"]
    end

    it "should be an invalid response" do
      @response.success.should == false
    end

    it "should have an error message" do
      @response.error_message.should == "API Key does not appear to be correct: API_KEY - 'api_key'"
    end

    it "should have a stacktrace" do
      @response.stacktrace.should_not == ""
    end

    it "should have no data tables" do
      @response.tables.size.should == 0
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
majestic_seo_api-1.3.1 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.3.0 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.2.8 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.2.7 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.2.6 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.2.5 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.2.4 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.2.3 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.2.2 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.2.1 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.2 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.1.3.1 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.1.3 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.1.2.1 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.1.2 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.1.1 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-1.1.0 spec/majestic_seo/top_back_links_response_spec.rb
majestic_seo_api-0.9.3 spec/majestic_seo/top_back_links_response_spec.rb