Sha256: bb06325f16300e00fe170560609d577857743a88d836c0482ce089921a431e9c

Contents?: true

Size: 962 Bytes

Versions: 9

Compression:

Stored size: 962 Bytes

Contents

#!/usr/bin/env ruby
require 'wwmd'
include WWMD
require 'spec'

describe Page do
  before(:each) do
    @page = Page.new({:base_url => "http://localhost"})
    @spider = @page.spider
    @spider.csrf_token = "CsRf"
  end

  it "should remove csrf tokens from visited and queued" do
    url = "http://localhost/foo.php?CsRf=something&bar=baz"
    links = ["http://localhost/q1.php?CsRf=omg&first=FIRST"]
    @spider.add(url,links)
    @spider.visited.first.should == "http://localhost/foo.php?CsRf=&bar=baz"
    @spider.queued.first.should == "http://localhost/q1.php?CsRf=&first=FIRST"
  end

  it "should work normally" do
    url = "http://localhost/foo.php?hithere=something&bar=baz"
    links = ["http://localhost/q1.php?hithere=omg&first=FIRST"]
    @spider.add(url,links)
    @spider.visited.first.should == "http://localhost/foo.php?hithere=something&bar=baz"
    @spider.queued.first.should == "http://localhost/q1.php?hithere=omg&first=FIRST"
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
iZsh-wwmd-0.2.19 spec/spider_csrf_test.spec
miketracy-wwmd-0.2.11 spec/spider_csrf_test.spec
miketracy-wwmd-0.2.12 spec/spider_csrf_test.spec
miketracy-wwmd-0.2.14 spec/spider_csrf_test.spec
miketracy-wwmd-0.2.15 spec/spider_csrf_test.spec
miketracy-wwmd-0.2.16 spec/spider_csrf_test.spec
miketracy-wwmd-0.2.17 spec/spider_csrf_test.spec
miketracy-wwmd-0.2.19 spec/spider_csrf_test.spec
wwmd-0.2.20.3 spec/spider_csrf_test.spec