diff options
-rw-r--r-- | app/views/issues/_form.html.erb | 2 | ||||
-rw-r--r-- | config/routes.rb | 3 | ||||
-rw-r--r-- | test/integration/issues_test.rb | 9 | ||||
-rw-r--r-- | test/integration/routing_test.rb | 2 |
4 files changed, 15 insertions, 1 deletions
diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 74562bff9..b5274c289 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -6,7 +6,7 @@ </p> <% end %> <p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %></p> -<%= observe_field :issue_tracker_id, :url => { :action => :new, :project_id => @project, :id => @issue }, +<%= observe_field :issue_tracker_id, :url => project_issue_form_path(@project, :id => @issue), :update => :attributes, :with => "Form.serialize('issue-form')" %> diff --git a/config/routes.rb b/config/routes.rb index 8b40a4fc7..0834084f6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -127,6 +127,9 @@ ActionController::Routing::Routes.draw do |map| project.resources :issues, :only => [:index, :new, :create] do |issues| issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} end + # issue form update + project.issue_form 'issues/new', :controller => 'issues', :action => 'new', :conditions => {:method => :post} + project.resources :files, :only => [:index, :new, :create] project.resources :versions, :shallow => true, :collection => {:close_completed => :put}, :member => {:status_by => :post} project.resources :news, :shallow => true diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb index 48ced6bc7..4f72b9839 100644 --- a/test/integration/issues_test.rb +++ b/test/integration/issues_test.rb @@ -64,6 +64,15 @@ class IssuesTest < ActionController::IntegrationTest assert_equal 1, issue.status.id end + def test_update_issue_form + log_user('jsmith', 'jsmith') + post 'projects/ecookbook/issues/new', :issue => { :tracker_id => "2"} + assert_response :success + assert_tag 'select', + :attributes => {:name => 'issue[tracker_id]'}, + :child => {:tag => 'option', :attributes => {:value => '2', :selected => 'selected'}} + end + # add then remove 2 attachments to an issue def test_issue_attachments log_user('jsmith', 'jsmith') diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 8309a831f..a62987039 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -97,6 +97,8 @@ class RoutingTest < ActionController::IntegrationTest should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml' should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' + # issue form update + should_route :post, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23' should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml' |