Fixed some minor bugs and add tests to spot them
authorKai Krueger <kakrueger@gmail.com>
Sat, 27 Mar 2010 11:45:36 +0000 (11:45 +0000)
committerKai Krueger <kakrueger@gmail.com>
Sat, 27 Mar 2010 11:45:36 +0000 (11:45 +0000)
app/controllers/map_bugs_controller.rb
app/views/map_bugs/rss.rss.builder
test/fixtures/map_bug_comment.yml
test/fixtures/map_bugs.yml
test/functional/map_bugs_controller_test.rb

index 8412d17f37496f0192cd49645de7d685b66cb24c..41881cfb79577ed0dc1a46b10e95de9bfccc3063 100644 (file)
@@ -214,10 +214,11 @@ class MapBugsController < ApplicationController
         else 
           conditions = ['false'] 
         end 
-      elsif request.format == :html 
+      else #if request.format == :html 
         @title = t 'user.no_such_user.title' 
         @not_found_user = params[:display_name] 
         render :template => 'user/no_such_user', :status => :not_found 
+               return
       end 
     end
 
index 9fc6fd19caf9fe71d55abf2fdcb5acf811efc0f5..a6487a024d9c6fa552d602d856826ac3ff5d7374 100644 (file)
@@ -36,7 +36,7 @@ xml.rss("version" => "2.0",
                if (comment.user.nil?)
                        xml.author comment.commenter_name
                else
-                       xml.author comment.user.dislay_name
+                       xml.author comment.user.display_name
                end
                
         xml.pubDate comment.date_created.to_s(:rfc822)
index 5ff9c36de5309895f5d422d610fc51e9ad69797a..2214c07646b4c887791151bbe0ae6ed1f9928d1a 100644 (file)
@@ -74,5 +74,55 @@ t8:
   commenter_ip: '192.168.1.1'
   comment: 'Another valid comment for bug 5'
 
+t9:
+  id: 9
+  bug_id: 6
+  visible: true
+  date_created: 2007-01-01 00:00:00
+  event: opened
+  commenter_id: 1
+  comment: 'This is a bug with from a logged-in user'
+
+
+t10:
+  id: 10
+  bug_id: 6
+  visible: true
+  date_created: 2007-02-01 00:00:00
+  event: commented
+  commenter_id: 4
+  comment: 'A comment from another logged-in user'
+
+
+t11:
+  id: 11
+  bug_id: 7
+  visible: true
+  event: opened
+  date_created: 2007-01-01 00:00:00
+  commenter_name: 'testname'
+  commenter_ip: '192.168.1.1'
+  comment: 'Initial bug description'
+
+
+t12:
+  id: 12
+  bug_id: 7
+  visible: true
+  event: commented
+  date_created: 2007-02-01 00:00:00
+  commenter_name: 'testname'
+  commenter_ip: '192.168.1.1'
+  comment: 'A comment description'
+
+t13:
+  id: 13
+  bug_id: 7
+  visible: true
+  event: closed
+  date_created: 2007-03-01 00:00:00
+  commenter_id: 4
+
+
 
 
index c0f6f1fa8bf9ffc3ebd6ad43be5de1638fd4c407..7c465ab0fc1187ffa8b6639ffae0e4bca48e25cf 100644 (file)
@@ -47,3 +47,23 @@ bug_with_hidden_comment:
   date_created: 2007-01-01 00:00:00
   last_changed: 2007-03-01 00:00:00
 
+bug_with_comments_by_users:
+  id: 6
+  latitude: <%= 1.5*SCALE %>
+  longitude: <%= 1.5*SCALE %>
+  status: open
+  tile: <%= QuadTile.tile_for_point(1.5,1.5) %>
+  date_created: 2007-01-01 00:00:00
+  last_changed: 2007-03-01 00:00:00
+
+
+bug_closed__by_user:
+  id: 7
+  latitude: <%= 1.6*SCALE %>
+  longitude: <%= 1.6*SCALE %>
+  status: closed
+  tile: <%= QuadTile.tile_for_point(1.6,1.6) %>
+  date_created: 2007-01-01 00:00:00
+  last_changed: 2007-03-01 00:00:00
+  date_closed:  2007-03-01 00:00:00
+
index b701e244e2e3b3f5569e8a3a9d42a538d02ad44d..c3335d2b10ec8f257523c4e8fb9edd73a0f09812 100644 (file)
@@ -125,6 +125,18 @@ class MapBugsControllerTest < ActionController::TestCase
        assert_response :success
   end
 
+  def test_user_bugs_success
+       get :my_bugs, {:display_name=>'test'}
+       assert_response :success
+
+       get :my_bugs, {:display_name=>'pulibc_test2'}
+       assert_response :success
+
+       get :my_bugs, {:display_name=>'non-existent'}
+       assert_response :not_found
+       
+  end
+
   def test_map_bug_comment_create_not_found
     assert_no_difference('MapBugComment.count') do
         post :edit_bug, {:id => 12345, :name => "new_tester", :text => "This is an additional comment"}