</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'%>
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