]> source.dussan.org Git - redmine.git/commitdiff
Fixed that logging time inside redirects at global time logging (#11038).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 29 May 2012 17:07:07 +0000 (17:07 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 29 May 2012 17:07:07 +0000 (17:07 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9740 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/timelog/new.html.erb
test/functional/timelog_controller_test.rb

index 84bf7dae18151cbcfd6935cd5af14007eca22099..95253e82ffeb4278ed00a49a4572451eec42d3d3 100644 (file)
@@ -1,6 +1,7 @@
 <h2><%= l(:label_spent_time) %></h2>
 
 <%= labelled_form_for @time_entry, :url => time_entries_path do |f| %>
+  <%= hidden_field_tag 'project_id', params[:project_id] if params[:project_id] %>
   <%= render :partial => 'form', :locals => {:f => f} %>
   <%= submit_tag l(:button_create) %>
   <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
index 410bbd3e5630efa98e7ef355483f62e68411751e..e64919f38c8c97ff6c99a4533ff57e01a307a0f8 100644 (file)
@@ -44,6 +44,7 @@ class TimelogControllerTest < ActionController::TestCase
     # Default activity selected
     assert_tag :tag => 'option', :attributes => { :selected => 'selected' },
                                  :content => 'Development'
+    assert_select 'input[name=project_id][value=1]'
   end
 
   def test_get_new_should_only_show_active_time_entry_activities
@@ -61,6 +62,7 @@ class TimelogControllerTest < ActionController::TestCase
     assert_response :success
     assert_template 'new'
     assert_tag 'select', :attributes => {:name => 'time_entry[project_id]'}
+    assert_select 'input[name=project_id]', 0
   end
 
   def test_new_without_project_should_deny_without_permission