Sha256: bc20cd562e464a1f4123e14f50909dc9ca616864205ce495e4bcedc6fdec63c2

Contents?: true

Size: 800 Bytes

Versions: 1

Compression:

Stored size: 800 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper'

describe Copyscape::UrlSearch do

  describe "request_url" do

    it "has the correct url" do
      Copyscape::UrlSearch.expects(:get).once.returns(url_search_response_duplicate).with do |path, options|
        params = options[:query]
        assert_equal '/', path
        assert_equal 'joe', params[:u]
        assert_equal '123abc', params[:k]
        assert_equal 'http://www.someurl.com/blah.html', params[:q]
        assert_equal 'csearch', params[:o]
      end
      @search = Copyscape::UrlSearch.new('http://www.someurl.com/blah.html')
    end
  end

  private

  def url_search_response_duplicate
    o = Object.new
    o.stubs(:body).returns(File.read(File.expand_path('../url_search_response_duplicate.xml', __FILE__)))
    o
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
copyscape-0.0.6 test/url_search_test.rb