aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm2
-rw-r--r--t/app/controller/around.t2
-rw-r--r--t/app/controller/report_new.t2
3 files changed, 3 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index 492565bb9..bad269a83 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -43,7 +43,7 @@ sub around_index : Path : Args(0) {
my $ret = $c->forward('/location/determine_location_from_coords')
|| $c->forward('/location/determine_location_from_pc');
return unless $ret;
- return $c->res->redirect('/') if $ret == -1;
+ return $c->res->redirect('/') if $ret == -1 && !$partial_report;
# Check to see if the spot is covered by a area - if not show an error.
return unless $c->cobrand->moniker eq 'fixmybarangay' || $c->forward('check_location_is_acceptable');
diff --git a/t/app/controller/around.t b/t/app/controller/around.t
index 0f01a9ea9..fa2d94aed 100644
--- a/t/app/controller/around.t
+++ b/t/app/controller/around.t
@@ -7,7 +7,7 @@ my $mech = FixMyStreet::TestMech->new;
subtest "check that if no query we get sent back to the homepage" => sub {
$mech->get_ok('/around');
- is $mech->uri->path, '/around', "still at '/around'";
+ is $mech->uri->path, '/', "redirected to '/'";
};
# x,y requests were generated by the old map code. We keep the behavior for
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index 868977953..722c3c39c 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -17,7 +17,7 @@ ok -e $sample_file, "sample file $sample_file exists";
subtest "test that bare requests to /report/new get redirected" => sub {
$mech->get_ok('/report/new');
- is $mech->uri->path, '/around', "went to /around";
+ is $mech->uri->path, '/', "went to /";
is_deeply { $mech->uri->query_form }, {}, "query empty";
$mech->get_ok('/report/new?pc=SW1A%201AA');
'>issues/2063-document-holding-pen Unnamed repository; edit this file 'description' to name the repository.MimesBrønn
aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/gems/rdoc-2.4.3/test/test_rdoc_parser_perl.rb
blob: 165cadaa5dc016b2b14cb13f743d33e58aa4208c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
require 'stringio'
require 'tempfile'
require 'rubygems'
require 'minitest/unit'
require 'rdoc/options'
require 'rdoc/parser/perl'

class TestRdocParserPerlPOD < MiniTest::Unit::TestCase

  def setup
    @tempfile = Tempfile.new self.class.name
    filename = @tempfile.path

    @top_level = RDoc::TopLevel.new filename
    @fn = filename
    @options = RDoc::Options.new
    @stats = RDoc::Stats.new 0
  end

  def teardown
    @tempfile.close
  end

  def test_uncommented_perl
    content = <<-EOF
while (<>) {
  tr/a-z/A-Z;
  print
}
    EOF

    comment =  util_get_comment content
    assert_equal "", comment
  end

  def test_perl_without_pod
    content = <<-EOF
#!/usr/local/bin/perl
#
#This is a pointless perl program because it does -p.
#
while(<>) {print;}:
    EOF

    comment = util_get_comment content
    assert_equal "", comment
  end

  def test_simple_pod_no_structure
    content = <<-EOF
=begin pod

This just contains plain old documentation

=end
    EOF
    comment = util_get_comment content
    assert_equal "\nThis just contains plain old documentation\n\n", comment
  end

  # Get the comment of the @top_level when it has processed the input.
  def util_get_comment(content)
    parser = util_parser content
    parser.scan.comment
  end

  # create a new parser with the supplied content.
  def util_parser(content)
    RDoc::Parser::PerlPOD.new @top_level, @fn, content, @options, @stats
  end

end

MiniTest::Unit.autorun