Sha256: 58c8d40805e6c1c9bafc28afebb8292fc62469d46c3bc4e103aae8d6d81a3403

Contents?: true

Size: 1020 Bytes

Versions: 7

Compression:

Stored size: 1020 Bytes

Contents

require "spec_helper"

describe MassiveSitemap do
  describe ".ping" do
    let(:url) { "http://www.example.com" }

    describe "verify_and_escape" do
      it { MassiveSitemap.verify_and_escape("example.com/test").should == "http%3A%2F%2Fexample.com%2Ftest" }
      it { MassiveSitemap.verify_and_escape("http://example.com/test").should == "http%3A%2F%2Fexample.com%2Ftest" }
      it { MassiveSitemap.verify_and_escape("https://example.com/test").should == "https%3A%2F%2Fexample.com%2Ftest" }

      it "raise if invalid url" do
        expect do
          MassiveSitemap.verify_and_escape("example.com/")
        end.to raise_error URI::InvalidURIError
      end
    end

    describe "ping" do
      it "calles google and ask" do
        MassiveSitemap.should_receive(:open).twice()
        MassiveSitemap.ping(url, [:google, :ask])
      end

      it "doesn't fail for unknown engines" do
        expect do
          MassiveSitemap.ping(url, :unknown)
        end.to_not raise_error
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
massive_sitemap-2.0.0 spec/ping_spec.rb
massive_sitemap-2.0.0.rc8 spec/ping_spec.rb
massive_sitemap-2.0.0.rc7 spec/ping_spec.rb
massive_sitemap-2.0.0.rc6 spec/ping_spec.rb
massive_sitemap-2.0.0.rc5 spec/ping_spec.rb
massive_sitemap-2.0.0.rc4 spec/ping_spec.rb
massive_sitemap-2.0.0.rc3 spec/ping_spec.rb