diff options
-rw-r--r-- | app/views/repositories/_related_issues.html.erb | 6 | ||||
-rw-r--r-- | test/functional/repositories_controller_test.rb | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/app/views/repositories/_related_issues.html.erb b/app/views/repositories/_related_issues.html.erb index 9d3074112..649cc70e8 100644 --- a/app/views/repositories/_related_issues.html.erb +++ b/app/views/repositories/_related_issues.html.erb @@ -24,12 +24,12 @@ </ul> <% if manage_allowed %> - <%= form_for(@issue, :as => :issue, :remote => true, - :url => {:controller => 'repositories', :action => 'add_related_issue', + <%= form_tag({:controller => 'repositories', :action => 'add_related_issue', :id => @project, :repository_id => @repository.identifier_param, :rev => @changeset.identifier}, + :remote => true, :method => :post, - :html => {:id => 'new-relation-form', :style => (@issue ? '' : 'display: none;')}) do |f| %> + :id => 'new-relation-form', :style => (@issue ? '' : 'display: none;')) do |f| %> <%= l(:label_issue) %> #<%= text_field_tag 'issue_id', '', :size => 10 %> <%= submit_tag l(:button_add) %> <%= toggle_link l(:button_cancel), 'new-relation-form'%> diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb index 50a0c8676..ae2f80d4a 100644 --- a/test/functional/repositories_controller_test.rb +++ b/test/functional/repositories_controller_test.rb @@ -166,6 +166,18 @@ class RepositoriesControllerTest < ActionController::TestCase assert_equal "1", assigns(:changeset).revision end + def test_revision_should_show_add_related_issue_form + Role.find(1).add_permission! :manage_related_issues + @request.session[:user_id] = 2 + + get :revision, :id => 1, :rev => 1 + assert_response :success + + assert_select 'form[action=?]', '/projects/ecookbook/repository/revisions/1/issues' do + assert_select 'input[name=?]', 'issue_id' + end + end + def test_revision_should_not_change_the_project_menu_link get :revision, :id => 1, :rev => 1 assert_response :success |