05_load-changesets-and-time-entries-tabs-async_r16963.patch

Marius BALTEANU, 2017-09-10 14:18

Download (34.4 KB)

View differences:

app/controllers/issues_controller.rb
18 18
class IssuesController < ApplicationController
19 19
  default_search_scope :issues
20 20

  
21
  before_action :find_issue, :only => [:show, :edit, :update]
21
  before_action :find_issue, :only => [:show, :edit, :update, :issue_tab]
22 22
  before_action :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
23 23
  before_action :authorize, :except => [:index, :new, :create]
24 24
  before_action :find_optional_project, :only => [:index, :new, :create]
......
83 83

  
84 84
  def show
85 85
    @journals = @issue.visible_journals_with_index
86
    @changesets = @issue.changesets.visible.preload(:repository, :user).to_a
86
    @has_changesets = @issue.changesets.visible.preload(:repository, :user).exists?
87 87
    @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
88 88

  
89
    if User.current.wants_comments_in_reverse_order?
90
      @journals.reverse!
91
      @changesets.reverse!
92
    end
89
    @journals.reverse! if User.current.wants_comments_in_reverse_order?
93 90

  
94 91
    if User.current.allowed_to?(:view_time_entries, @project)
95 92
      Issue.load_visible_spent_hours([@issue])
......
106 103
        retrieve_previous_and_next_issue_ids
107 104
        render :template => 'issues/show'
108 105
      }
109
      format.api
106
      format.api {
107
        @changesets = @issue.changesets.visible.preload(:repository, :user).to_a
108
        @changesets.reverse! if User.current.wants_comments_in_reverse_order?
109
      }
110 110
      format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
111 111
      format.pdf  {
112 112
        send_file_headers! :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf"
......
191 191
    end
192 192
  end
193 193

  
194
  def issue_tab
195
    return render_error :status => 422 unless request.xhr?
196
    tab = params[:name]
197

  
198
    case tab
199
    when 'time_entries'
200
      @time_entries = @issue.time_entries.visible.preload(:activity, :user).to_a
201
      render :partial => 'issues/tabs/time_entries', :locals => {:time_entries => @time_entries}
202
    when 'changesets'
203
      @changesets = @issue.changesets.visible.preload(:repository, :user).to_a
204
      changesets.reverse! if User.current.wants_comments_in_reverse_order?
205
      render :partial => 'issues/tabs/changesets', :locals => {:changesets => @changesets}
206
    end
207
  end
208

  
194 209
  # Bulk edit/copy a set of issues
195 210
  def bulk_edit
196 211
    @issues.sort!
app/helpers/issues_helper.rb
552 552
      tabs << {:name => 'notes', :label => :label_issue_history_notes, :onclick => 'showIssueHistory("notes", this.href)'} if journals_with_notes.any?
553 553
      tabs << {:name => 'properties', :label => :label_issue_history_properties, :onclick => 'showIssueHistory("properties", this.href)'} if journals_without_notes.any?
554 554
    end
555
    tabs << {:name => 'time_entries', :label => :label_time_entry_plural, :partial => 'issues/tabs/time_entries', :locals => {:time_entries => @time_entries}} if User.current.allowed_to?(:view_time_entries, @project) && @issue.spent_hours > 0
556
    tabs << {:name => 'changesets', :label => :label_associated_revisions, :partial => 'issues/tabs/changesets', :locals => {:changesets => @changesets}} if @changesets.present?
555
    tabs << {:name => 'time_entries', :label => :label_time_entry_plural, :remote => true, :onclick => "getRemoteTab('time_entries', '#{tab_issue_path(@issue, :name => 'time_entries')}', '#{issue_path(@issue, :tab => 'time_entries')}')"} if User.current.allowed_to?(:view_time_entries, @project) && @issue.spent_hours > 0
556
    tabs << {:name => 'changesets', :label => :label_associated_revisions, :remote => true, :onclick => "getRemoteTab('changesets', '#{tab_issue_path(@issue, :name => 'changesets')}', '#{issue_path(@issue, :tab => 'changesets')}')"} if @has_changesets
557 557
    tabs
558 558
  end
559

  
559 560
end
app/views/common/_tabs.html.erb
18 18
</div>
19 19

  
20 20
<% tabs.each do |tab| -%>
21
  <%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ),
21
  <%= content_tag('div', (render(:partial => tab[:partial], :locals => {:tab => tab}) if tab[:partial]) ,
22 22
                       :id => "tab-content-#{tab[:name]}",
23 23
                       :style => (tab[:name] != selected_tab ? 'display:none' : nil),
24
                       :class => 'tab-content') if tab[:partial] %>
24
                       :class => 'tab-content') if tab[:partial] || tab[:remote] %>
25 25
<% end -%>
26 26

  
27 27
<%= javascript_tag default_action if default_action %>
app/views/issues/_changesets.html.erb
1
<% changesets.each do |changeset| %>
2
    <div class="changeset">
3
    <p><%= link_to_revision(changeset, changeset.repository,
4
                            :text => "#{l(:label_revision)} #{changeset.format_identifier}") %>
5
        <% if changeset.filechanges.any? && User.current.allowed_to?(:browse_repository, changeset.project) %>
6
        (<%= link_to(l(:label_diff),
7
               :controller => 'repositories',
8
               :action => 'diff',
9
               :id     => changeset.project,
10
               :repository_id => changeset.repository.identifier_param,
11
               :path   => "",
12
               :rev    => changeset.identifier) %>)
13
        <% end %>
14
        <br />
15
        <span class="author"><%= authoring(changeset.committed_on, changeset.author) %></span></p>
16
    <div class="wiki changeset-comments">
17
        <%= format_changeset_comments changeset %>
18
    </div>
19
    </div>
20
<% end %>
app/views/issues/tabs/_changesets.html.erb
1
<% tab[:locals][:changesets].each do |changeset| %>
1
<% @changesets.each do |changeset| %>
2 2
  <div id="changeset-<%= changeset.id %>" class="changeset journal">
3 3
    <h4>
4 4
      <%= avatar(changeset.user, :size => "24") %>
app/views/issues/tabs/_time_entries.html.erb
1
<% for time_entry in tab[:locals][:time_entries] %>
1
<% for time_entry in time_entries%>
2 2
  <div id="time-entry-<%= time_entry.id %>" class="time_entry journal">
3 3
    <% if time_entry.editable_by?(User.current) -%>
4 4
      <div class="contextual">
config/routes.rb
186 186
    member do
187 187
      # Used when updating the form of an existing issue
188 188
      patch 'edit', :to => 'issues#edit'
189
      get 'tab/:name', :action => 'issue_tab', :as => 'tab'
189 190
    end
190 191
    collection do
191 192
      match 'bulk_edit', :via => [:get, :post]
lib/redmine.rb
90 90

  
91 91
  map.project_module :issue_tracking do |map|
92 92
    # Issues
93
    map.permission :view_issues, {:issues => [:index, :show],
93
    map.permission :view_issues, {:issues => [:index, :show, :issue_tab],
94 94
                                  :auto_complete => [:issues],
95 95
                                  :context_menus => [:issues],
96 96
                                  :versions => [:index, :show, :status_by],
public/javascripts/application.js
370 370
  return false;
371 371
}
372 372

  
373
function getRemoteTab(name, remote_url, url) {
374
  $('#tab-content-' + name).parent().find('.tab-content').hide();
375
  $('#tab-content-' + name).parent().find('div.tabs a').removeClass('selected');
376
  $('#tab-' + name).addClass('selected')
377

  
378
  replaceInHistory(url)
379

  
380
  $.ajax({
381
    url: remote_url,
382
    type: 'get',
383
    success: function(data){
384
      $('#tab-content-' + name).html(data).show();
385
    }
386
  });
387

  
388
  return false;
389
}
390

  
373 391
//replaces current URL with the "href" attribute of the current link
374 392
//(only triggered if supported by browser)
375 393
function replaceInHistory(url) {
test/functional/issues_controller_test.rb
152 152
        :f => ['tracker_id'],
153 153
        :op => {
154 154
          'tracker_id' => '='
155
        },  
155
        },
156 156
        :v => {
157 157
          'tracker_id' => ['1']
158 158
        }
......
253 253
        :f => [filter_name],
254 254
        :op => {
255 255
          filter_name => '='
256
        },  
256
        },
257 257
        :v => {
258 258
          filter_name => ['Foo']
259
        },  
259
        },
260 260
        :c => ['project']
261 261
      }
262 262
    assert_response :success
......
1447 1447
        :f => ['start_date'],
1448 1448
        :op => {
1449 1449
          :start_date => '='
1450
        },  
1450
        },
1451 1451
        :format => 'csv'
1452 1452
      }
1453 1453
    assert_equal 'text/csv', @response.content_type
......
1997 1997
    project.disable_module! :repository
1998 1998

  
1999 1999
    @request.session[:user_id] = 2
2000
    get :show, :params => {
2001
        :id => issue.id
2002
      }
2000
    get :issue_tab, :params => {
2001
        :id => issue.id,
2002
        :name => 'changesets'
2003
      },
2004
      :xhr => true
2003 2005

  
2004 2006
    assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/3'
2005 2007
  end
......
2359 2361
      assert_select 'div.tabs a[id=?]', 'tab-time_entries', :text => 'Spent time'
2360 2362
    end
2361 2363

  
2364
    get :issue_tab, :params => {
2365
        :id => 3,
2366
        :name => 'time_entries'
2367
      },
2368
      :xhr => true
2369
    assert_response :success
2370

  
2362 2371
    assert_select 'div[id=?]', 'time-entry-3' do
2363 2372
      assert_select 'a[title=?][href=?]', 'Edit', '/time_entries/3/edit'
2364 2373
      assert_select 'a[title=?][href=?]', 'Delete', '/time_entries/3'
......
2709 2718
          :tracker_id => 3,
2710 2719
          :description => 'Prefilled',
2711 2720
          :custom_field_values => {
2712
          '2' => 'Custom field value'}    
2721
          '2' => 'Custom field value'}
2713 2722
        }
2714 2723
      }
2715 2724

  
......
2833 2842
    assert !t.disabled_core_fields.include?('parent_issue_id')
2834 2843

  
2835 2844
    get :new, :params => {
2836
        :project_id => 1, issue: { parent_issue_id: 1 
2845
        :project_id => 1, issue: { parent_issue_id: 1
2837 2846
      }
2838 2847
      }
2839 2848
    assert_response :success
......
2843 2852
    t.save!
2844 2853
    assert t.disabled_core_fields.include?('parent_issue_id')
2845 2854
    get :new, :params => {
2846
        :project_id => 1, issue: { parent_issue_id: 1 
2855
        :project_id => 1, issue: { parent_issue_id: 1
2847 2856
      }
2848 2857
      }
2849 2858
    assert_response :success
......
2901 2910
        :issue => {
2902 2911
          :tracker_id => 2,
2903 2912
          :status_id => 1
2904
        },  
2913
        },
2905 2914
        :was_default_status => 1
2906 2915
      }
2907 2916
    assert_response :success
......
2920 2929
        :issue => {
2921 2930
          :project_id => 1,
2922 2931
          :fixed_version_id => ''
2923
        },  
2932
        },
2924 2933
        :form_update_triggered_by => 'issue_project_id'
2925 2934
      }
2926 2935
    assert_response :success
......
2948 2957
              :start_date => '2010-11-07',
2949 2958
              :estimated_hours => '',
2950 2959
              :custom_field_values => {
2951
              '2' => 'Value for field 2'}    
2960
              '2' => 'Value for field 2'}
2952 2961
            }
2953 2962
          }
2954 2963
      end
......
3007 3016
              :priority_id => 5,
3008 3017
              :estimated_hours => '',
3009 3018
              :custom_field_values => {
3010
              '2' => 'Value for field 2'}    
3019
              '2' => 'Value for field 2'}
3011 3020
            }
3012 3021
          }
3013 3022
      end
......
3033 3042
              :priority_id => 5,
3034 3043
              :estimated_hours => '',
3035 3044
              :custom_field_values => {
3036
              '2' => 'Value for field 2'}    
3045
              '2' => 'Value for field 2'}
3037 3046
            }
3038 3047
          }
3039 3048
      end
......
3054 3063
            :tracker_id => 3,
3055 3064
            :subject => 'This is first issue',
3056 3065
            :priority_id => 5
3057
          },  
3066
          },
3058 3067
          :continue => ''
3059 3068
        }
3060 3069
    end
......
3096 3105
            :description => 'This is the description',
3097 3106
            :priority_id => 5,
3098 3107
            :custom_field_values => {
3099
            '1' => ['', 'MySQL', 'Oracle']}    
3108
            '1' => ['', 'MySQL', 'Oracle']}
3100 3109
          }
3101 3110
        }
3102 3111
    end
......
3119 3128
            :description => 'This is the description',
3120 3129
            :priority_id => 5,
3121 3130
            :custom_field_values => {
3122
            '1' => ['']}    
3131
            '1' => ['']}
3123 3132
          }
3124 3133
        }
3125 3134
    end
......
3142 3151
            :description => 'This is the description',
3143 3152
            :priority_id => 5,
3144 3153
            :custom_field_values => {
3145
            field.id.to_s => ['', '2', '3']}    
3154
            field.id.to_s => ['', '2', '3']}
3146 3155
          }
3147 3156
        }
3148 3157
    end
......
3190 3199
            :due_date => '',
3191 3200
            :custom_field_values => {
3192 3201
              cf1.id.to_s => '', cf2.id.to_s => ''
3193
            }    
3194
            
3202
            }
3203

  
3195 3204
          }
3196 3205
        }
3197 3206
      assert_response :success
......
3220 3229
            :due_date => '',
3221 3230
            :custom_field_values => {
3222 3231
              cf1.id.to_s => '', cf2.id.to_s => ['']
3223
            }    
3224
            
3232
            }
3233

  
3225 3234
          }
3226 3235
        }
3227 3236
      assert_response :success
......
3250 3259
            :due_date => '2012-07-16',
3251 3260
            :custom_field_values => {
3252 3261
              cf1.id.to_s => 'value1', cf2.id.to_s => 'value2'
3253
            }    
3254
            
3262
            }
3263

  
3255 3264
          }
3256 3265
        }
3257 3266
      assert_response 302
......
3277 3286
            :tracker_id => 1,
3278 3287
            :status_id => 1,
3279 3288
            :subject => 'Test'
3280
            
3289

  
3281 3290
          }
3282 3291
        }
3283 3292
      assert_response 302
......
3455 3464
            :project_id => 3,
3456 3465
            :tracker_id => 2,
3457 3466
            :subject => 'Foo'
3458
          },  
3467
          },
3459 3468
          :continue => '1'
3460 3469
        }
3461 3470
      assert_redirected_to '/issues/new?issue%5Bproject_id%5D=3&issue%5Btracker_id%5D=2'
......
3508 3517
              :priority_id => 5,
3509 3518
              :estimated_hours => '',
3510 3519
              :custom_field_values => {
3511
              '2' => 'Value for field 2'}    
3520
              '2' => 'Value for field 2'}
3512 3521
            }
3513 3522
          }
3514 3523
      end
......
3567 3576
      post :create, :params => {
3568 3577
          :project_id => 1,
3569 3578
          :issue => {
3570
            :tracker => "A param can not be a Tracker" 
3579
            :tracker => "A param can not be a Tracker"
3571 3580
          }
3572 3581
        }
3573 3582
    end
......
3584 3593
              :project_id => 1,
3585 3594
              :issue => {
3586 3595
                :tracker_id => '1',
3587
                :subject => 'With attachment' 
3588
              },  
3596
                :subject => 'With attachment'
3597
              },
3589 3598
              :attachments => {
3590 3599
                '1' => {
3591
                'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}    
3600
                'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}
3592 3601
              }
3593 3602
            }
3594 3603
        end
......
3619 3628
            :project_id => 1,
3620 3629
            :issue => {
3621 3630
              :tracker_id => '1',
3622
              :subject => 'With attachment' 
3623
            },  
3631
              :subject => 'With attachment'
3632
            },
3624 3633
            :attachments => {
3625 3634
              '1' => {
3626
              'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}    
3635
              'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}
3627 3636
            }
3628 3637
          }
3629 3638
      end
......
3645 3654
            :project_id => 1,
3646 3655
            :issue => {
3647 3656
              :tracker_id => '1',
3648
              :subject => '' 
3649
            },  
3657
              :subject => ''
3658
            },
3650 3659
            :attachments => {
3651 3660
              '1' => {
3652
              'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}    
3661
              'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}
3653 3662
            }
3654 3663
          }
3655 3664
        assert_response :success
......
3676 3685
            :project_id => 1,
3677 3686
            :issue => {
3678 3687
              :tracker_id => '1',
3679
              :subject => '' 
3680
            },  
3688
              :subject => ''
3689
            },
3681 3690
            :attachments => {
3682 3691
              'p0' => {
3683
              'token' => attachment.token}    
3692
              'token' => attachment.token}
3684 3693
            }
3685 3694
          }
3686 3695
        assert_response :success
......
3702 3711
            :project_id => 1,
3703 3712
            :issue => {
3704 3713
              :tracker_id => '1',
3705
              :subject => 'Saved attachments' 
3706
            },  
3714
              :subject => 'Saved attachments'
3715
            },
3707 3716
            :attachments => {
3708 3717
              'p0' => {
3709
              'token' => attachment.token}    
3718
              'token' => attachment.token}
3710 3719
            }
3711 3720
          }
3712 3721
        assert_response 302
......
4004 4013
            :project_id => '1',
4005 4014
            :tracker_id => '1',
4006 4015
            :status_id => '1'
4007
          },  
4016
          },
4008 4017
          :was_default_status => '1'
4009 4018
        }
4010 4019
    end
......
4048 4057
              :tracker_id => '3',
4049 4058
              :status_id => '1',
4050 4059
              :subject => 'Copy with attachments'
4051
            },  
4060
            },
4052 4061
            :copy_attachments => '1'
4053 4062
          }
4054 4063
      end
......
4096 4105
              :tracker_id => '3',
4097 4106
              :status_id => '1',
4098 4107
              :subject => 'Copy with attachments'
4099
            },  
4108
            },
4100 4109
            :copy_attachments => '1',
4101 4110
            :attachments => {
4102 4111
              '1' => {
......
4195 4204
            :tracker_id => '3',
4196 4205
            :status_id => '1',
4197 4206
            :subject => 'Copy with subtasks'
4198
          },  
4207
          },
4199 4208
          :copy_subtasks => '1'
4200 4209
        }
4201 4210
    end
......
4219 4228
            :status_id => '1',
4220 4229
            :subject => 'Copy with subtasks',
4221 4230
            :custom_field_values => {
4222
            '2' => 'Foo'}    
4223
          },  
4231
            '2' => 'Foo'}
4232
          },
4224 4233
          :copy_subtasks => '1'
4225 4234
        }
4226 4235
    end
......
4361 4370
        :id => 1,
4362 4371
        :issue => {
4363 4372
          :status_id => 5,
4364
          :priority_id => 7 
4365
        },  
4373
          :priority_id => 7
4374
        },
4366 4375
        :time_entry => {
4367 4376
          :hours => '2.5',
4368 4377
          :comments => 'test_get_edit_with_params',
4369
          :activity_id => 10 
4378
          :activity_id => 10
4370 4379
        }
4371 4380
      }
4372 4381
    assert_response :success
......
4605 4614
                :project_id => '1',
4606 4615
                :tracker_id => '2',
4607 4616
                :priority_id => '6'
4608
                
4617

  
4609 4618
              }
4610 4619
            }
4611 4620
        end
......
4668 4677
            :issue => {
4669 4678
              :subject => 'Custom field change',
4670 4679
              :custom_field_values => {
4671
                '1' => ['', 'Oracle', 'PostgreSQL'] 
4672
              }    
4673
              
4680
                '1' => ['', 'Oracle', 'PostgreSQL']
4681
              }
4682

  
4674 4683
            }
4675 4684
          }
4676 4685
      end
......
4691 4700
            :issue => {
4692 4701
              :status_id => 2,
4693 4702
              :assigned_to_id => 3,
4694
              :notes => 'Assigned to dlopper' 
4695
            },  
4703
              :notes => 'Assigned to dlopper'
4704
            },
4696 4705
            :time_entry => {
4697 4706
              :hours => '',
4698 4707
              :comments => '',
4699
              :activity_id => TimeEntryActivity.first 
4708
              :activity_id => TimeEntryActivity.first
4700 4709
            }
4701 4710
          }
4702 4711
      end
......
4722 4731
      put :update, :params => {
4723 4732
          :id => 1,
4724 4733
          :issue => {
4725
            :notes => notes 
4734
            :notes => notes
4726 4735
          }
4727 4736
        }
4728 4737
    end
......
4790 4799
      put :update, :params => {
4791 4800
          :id => 1,
4792 4801
          :issue => {
4793
            :notes => '2.5 hours added' 
4794
          },  
4802
            :notes => '2.5 hours added'
4803
          },
4795 4804
          :time_entry => {
4796 4805
            :hours => '2.5',
4797 4806
            :comments => 'test_put_update_with_note_and_spent_time',
4798
            :activity_id => TimeEntryActivity.first.id 
4807
            :activity_id => TimeEntryActivity.first.id
4799 4808
          }
4800 4809
        }
4801 4810
    end
......
4849 4858
            :id => 1,
4850 4859
            :issue => {
4851 4860
              :notes => ''
4852
            },  
4861
            },
4853 4862
            :attachments => {
4854 4863
              '1' => {
4855
              'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}    
4864
              'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}
4856 4865
            }
4857 4866
          }
4858 4867
      end
......
4888 4897
        put :update, :params => {
4889 4898
            :id => 1,
4890 4899
            :issue => {
4891
              :subject => '' 
4892
            },  
4900
              :subject => ''
4901
            },
4893 4902
            :attachments => {
4894 4903
              '1' => {
4895
              'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}    
4904
              'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}
4896 4905
            }
4897 4906
          }
4898 4907
        assert_response :success
......
4918 4927
        put :update, :params => {
4919 4928
            :id => 1,
4920 4929
            :issue => {
4921
              :subject => '' 
4922
            },  
4930
              :subject => ''
4931
            },
4923 4932
            :attachments => {
4924 4933
              'p0' => {
4925
              'token' => attachment.token}    
4934
              'token' => attachment.token}
4926 4935
            }
4927 4936
          }
4928 4937
        assert_response :success
......
4945 4954
              :id => 1,
4946 4955
              :issue => {
4947 4956
                :notes => 'Attachment added'
4948
              },  
4957
              },
4949 4958
              :attachments => {
4950 4959
                'p0' => {
4951
                'token' => attachment.token}    
4960
                'token' => attachment.token}
4952 4961
              }
4953 4962
            }
4954 4963
          assert_redirected_to '/issues/1'
......
4973 4982
          :id => 1,
4974 4983
          :issue => {
4975 4984
            :notes => ''
4976
          },  
4985
          },
4977 4986
          :attachments => {
4978 4987
            '1' => {
4979
            'file' => uploaded_test_file('testfile.txt', 'text/plain')}    
4988
            'file' => uploaded_test_file('testfile.txt', 'text/plain')}
4980 4989
          }
4981 4990
        }
4982 4991
      assert_redirected_to :action => 'show', :id => '1'
......
4996 5005
            :issue => {
4997 5006
              :notes => 'Removing attachments',
4998 5007
              :deleted_attachment_ids => ['1', '5']
4999
              
5008

  
5000 5009
            }
5001 5010
          }
5002 5011
      end
......
5023 5032
              :subject => '',
5024 5033
              :notes => 'Removing attachments',
5025 5034
              :deleted_attachment_ids => ['1', '5']
5026
              
5035

  
5027 5036
            }
5028 5037
          }
5029 5038
      end
......
5066 5075
            :subject => new_subject,
5067 5076
            :priority_id => '6',
5068 5077
            :category_id => '1' # no change
5069
            
5078

  
5070 5079
          }
5071 5080
        }
5072 5081
      assert_equal 1, ActionMailer::Base.deliveries.size
......
5082 5091
          :id => 1,
5083 5092
          :issue => {
5084 5093
            :notes => notes
5085
          },  
5094
          },
5086 5095
          :time_entry => {
5087 5096
            "comments"=>"", "activity_id"=>"", "hours"=>"2z"
5088 5097
          }
......
5104 5113
          :id => 1,
5105 5114
          :issue => {
5106 5115
            :notes => notes
5107
          },  
5116
          },
5108 5117
          :time_entry => {
5109 5118
            "comments"=>"this is my comment", "activity_id"=>"", "hours"=>""
5110 5119
          }
......
5126 5135
        :id => issue.id,
5127 5136
        :issue => {
5128 5137
          :fixed_version_id => 4
5129
          
5138

  
5130 5139
        }
5131 5140
      }
5132 5141

  
......
5144 5153
        :id => issue.id,
5145 5154
        :issue => {
5146 5155
          :fixed_version_id => 4
5147
          
5148
        },  
5156

  
5157
        },
5149 5158
        :back_url => '/issues'
5150 5159
      }
5151 5160

  
......
5161 5170
        :id => issue.id,
5162 5171
        :issue => {
5163 5172
          :fixed_version_id => 4
5164
          
5165
        },  
5173

  
5174
        },
5166 5175
        :back_url => 'http://google.com'
5167 5176
      }
5168 5177

  
......
5178 5187
        :issue => {
5179 5188
          :status_id => 6,
5180 5189
          :notes => 'Notes'
5181
        },  
5190
        },
5182 5191
        :prev_issue_id => 8,
5183 5192
        :next_issue_id => 12,
5184 5193
        :issue_position => 2,
......
5467 5476
          :priority_id => 7,
5468 5477
          :assigned_to_id => '',
5469 5478
          :custom_field_values => {
5470
          '2' => ''}    
5479
          '2' => ''}
5471 5480
        }
5472 5481
      }
5473 5482

  
......
5497 5506
            :priority_id => '',
5498 5507
            :assigned_to_id => group.id,
5499 5508
            :custom_field_values => {
5500
            '2' => ''}    
5509
            '2' => ''}
5501 5510
          }
5502 5511
        }
5503 5512

  
......
5516 5525
          :priority_id => 7,
5517 5526
          :assigned_to_id => '',
5518 5527
          :custom_field_values => {
5519
          '2' => ''}    
5528
          '2' => ''}
5520 5529
        }
5521 5530
      }
5522 5531

  
......
5544 5553
          :priority_id => 7,
5545 5554
          :assigned_to_id => '',
5546 5555
          :custom_field_values => {
5547
          '2' => ''}    
5556
          '2' => ''}
5548 5557
        }
5549 5558
      }
5550 5559
    assert_response 403
......
5592 5601
        :id => 1,
5593 5602
        :issue => {
5594 5603
          :project_id => '2'
5595
        },  
5604
        },
5596 5605
        :follow => '1'
5597 5606
      }
5598 5607
    assert_redirected_to '/issues/1'
......
5604 5613
        :id => [1, 2],
5605 5614
        :issue => {
5606 5615
          :project_id => '2'
5607
        },  
5616
        },
5608 5617
        :follow => '1'
5609 5618
      }
5610 5619
    assert_redirected_to '/projects/onlinestore/issues'
......
5711 5720
          :priority_id => '',
5712 5721
          :assigned_to_id => '',
5713 5722
          :custom_field_values => {
5714
          '2' => '777'}    
5723
          '2' => '777'}
5715 5724
        }
5716 5725
      }
5717 5726

  
......
5734 5743
          :priority_id => '',
5735 5744
          :assigned_to_id => '',
5736 5745
          :custom_field_values => {
5737
          '1' => '__none__'}    
5746
          '1' => '__none__'}
5738 5747
        }
5739 5748
      }
5740 5749
    assert_response 302
......
5754 5763
          :priority_id => '',
5755 5764
          :assigned_to_id => '',
5756 5765
          :custom_field_values => {
5757
          '1' => ['MySQL', 'Oracle']}    
5766
          '1' => ['MySQL', 'Oracle']}
5758 5767
        }
5759 5768
      }
5760 5769

  
......
5778 5787
          :priority_id => '',
5779 5788
          :assigned_to_id => '',
5780 5789
          :custom_field_values => {
5781
          '1' => ['__none__']}    
5790
          '1' => ['__none__']}
5782 5791
        }
5783 5792
      }
5784 5793
    assert_response 302
......
5934 5943
            :ids => [1, 2],
5935 5944
            :issue => {
5936 5945
              :project_id => '2'
5937
            },  
5946
            },
5938 5947
            :copy => '1'
5939 5948
          }
5940 5949
      end
......
5956 5965
          :ids => [1, 2, 3],
5957 5966
          :issue => {
5958 5967
            :project_id => '2'
5959
          },  
5968
          },
5960 5969
          :copy => '1'
5961 5970
        }
5962 5971
      assert_response 302
......
5971 5980
        :ids => [1, 2, 3],
5972 5981
        :issue => {
5973 5982
          :project_id => ''
5974
        },  
5983
        },
5975 5984
        :copy => '1'
5976 5985
      }
5977 5986
    assert_response 403
......
5985 5994
        :ids => [1, 2, 3],
5986 5995
        :issue => {
5987 5996
          :project_id => '1'
5988
        },  
5997
        },
5989 5998
        :copy => '1'
5990 5999
      }
5991 6000
    assert_response 403
......
6012 6021
            :status_id => '',
6013 6022
            :start_date => '',
6014 6023
            :due_date => ''
6015
            
6024

  
6016 6025
          }
6017 6026
        }
6018 6027
    end
......
6052 6061
              :status_id => '1',
6053 6062
              :start_date => '2009-12-01',
6054 6063
              :due_date => '2009-12-31'
6055
              
6064

  
6056 6065
            }
6057 6066
          }
6058 6067
      end
......
6082 6091
            :status_id => '3',
6083 6092
            :start_date => '2009-12-01',
6084 6093
            :due_date => '2009-12-31'
6085
            
6094

  
6086 6095
          }
6087 6096
        }
6088 6097
    end
......
6105 6114
            :copy_attachments => '0',
6106 6115
            :issue => {
6107 6116
              :project_id => ''
6108
              
6117

  
6109 6118
            }
6110 6119
          }
6111 6120
      end
......
6125 6134
            :copy_attachments => '1',
6126 6135
            :issue => {
6127 6136
              :project_id => ''
6128
              
6137

  
6129 6138
            }
6130 6139
          }
6131 6140
      end
......
6143 6152
            :link_copy => '1',
6144 6153
            :issue => {
6145 6154
              :project_id => '1'
6146
              
6155

  
6147 6156
            }
6148 6157
          }
6149 6158
      end
......
6161 6170
          :copy_subtasks => '0',
6162 6171
          :issue => {
6163 6172
            :project_id => ''
6164
            
6173

  
6165 6174
          }
6166 6175
        }
6167 6176
    end
......
6179 6188
          :copy_subtasks => '1',
6180 6189
          :issue => {
6181 6190
            :project_id => ''
6182
            
6191

  
6183 6192
          }
6184 6193
        }
6185 6194
    end
......
6198 6207
          :copy_watchers => '1',
6199 6208
          :issue => {
6200 6209
            :project_id => ''
6201
            
6210

  
6202 6211
          }
6203 6212
        }
6204 6213
    end
......
6218 6227
          :copy_subtasks => '1',
6219 6228
          :issue => {
6220 6229
            :project_id => ''
6221
            
6230

  
6222 6231
          }
6223 6232
        }
6224 6233
    end
......
6233 6242
        :copy => '1',
6234 6243
        :issue => {
6235 6244
          :project_id => 2
6236
        },  
6245
        },
6237 6246
        :follow => '1'
6238 6247
      }
6239 6248
    issue = Issue.order('id DESC').first
test/integration/routing/issues_test.rb
33 33
    should_route 'GET /issues/64/edit' => 'issues#edit', :id => '64'
34 34
    should_route 'PUT /issues/64' => 'issues#update', :id => '64'
35 35
    should_route 'DELETE /issues/64' => 'issues#destroy', :id => '64'
36

  
37
    should_route "GET /issues/3/tab/time_entries" => 'issues#issue_tab', :id => '3', :name => 'time_entries'
36 38
  end
37 39

  
38 40
  def test_issues_bulk_edit