1. Unofficial Redmine Clones
  2. Untitled project
  3. redmine-all

Commits

jplang  committed 47f95cb

Fixed watchers dialog on new issue.

  • Participants
  • Parent commits 1d421ed
  • Branches ../sandbox/rails-3.2

Comments (0)

Files changed (3)

File app/controllers/watchers_controller.rb

View file
       @watched = klass.find(params[:object_id])
       @project = @watched.project
     elsif params[:project_id]
-      @project = Project.visible.find(params[:project_id])
+      @project = Project.visible.find_by_param(params[:project_id])
     end
   rescue
     render_404

File app/models/project.rb

View file
     end
   end
 
+  def self.find_by_param(*args)
+    self.find(*args)
+  end
+
   def reload(*args)
     @shared_versions = nil
     @rolled_up_versions = nil

File test/functional/watchers_controller_test.rb

View file
     @request.session[:user_id] = 2
     xhr :get, :new, :project_id => 1
     assert_response :success
+    assert_equal Project.find(1), assigns(:project)
+    assert_select_rjs :replace_html, 'ajax-modal'
+  end
+
+  def test_new_for_new_record
+    @request.session[:user_id] = 2
+    xhr :get, :new, :project_id => 'ecookbook'
+    assert_response :success
+    assert_equal Project.find(1), assigns(:project)
     assert_select_rjs :replace_html, 'ajax-modal'
   end