spec/arachni/spider_spec.rb in arachni-0.4.1.2 vs spec/arachni/spider_spec.rb in arachni-0.4.1.3

- old
+ new

@@ -180,15 +180,29 @@ spider = Arachni::Spider.new spider.run.should be_empty spider.redirects.size.should == 1 end end + it 'should follow relative redirect locations' do + @opts.url = @url + '/relative_redirect' + @opts.redirect_limit = -1 + + spider = Arachni::Spider.new + spider.run.select { |url| url.include?( 'stacked_redirect4' ) }.should be_any + end it 'should follow stacked redirects' do @opts.url = @url + '/stacked_redirect' @opts.redirect_limit = -1 spider = Arachni::Spider.new spider.run.select { |url| url.include?( 'stacked_redirect4' ) }.should be_any + end + it 'should not follow stacked redirects that exceed the limit' do + @opts.url = @url + '/stacked_redirect' + @opts.redirect_limit = 3 + + spider = Arachni::Spider.new + spider.run.size.should == 3 end context 'when called with options and a block' do describe :pass_pages_to_block do describe true do it 'should pass the block each page as visited' do