Project

General

Profile

Defect #33550 » 0001-Do-not-display-in-issue-edit-page-spent-time-custom-.patch

Marius BĂLTEANU, 2021-03-15 22:27

View differences:

app/views/issues/_edit.html.erb
21 21
        </div>
22 22
        </div>
23 23
        <p><%= time_entry.text_field :comments, :size => 60 %></p>
24
        <% @time_entry.custom_field_values.each do |value| %>
24
        <% @time_entry.editable_custom_field_values.each do |value| %>
25 25
          <p><%= custom_field_tag_with_label :time_entry, value %></p>
26 26
        <% end %>
27 27
        <% end %>
test/functional/issues_controller_test.rb
5658 5658
    assert_select 'span.icon-warning[title=?]', reason, :text => reason
5659 5659
  end
5660 5660

  
5661
  def test_get_edit_should_display_visible_spent_time_custom_field
5662
    @request.session[:user_id] = 2
5663

  
5664
    get(
5665
      :edit,
5666
      :params => {
5667
        :id => 13,
5668
      }
5669
    )
5670

  
5671
    assert_response :success
5672

  
5673
    assert_select '#issue-form select.cf_10', 1
5674
  end
5675

  
5676
  def test_get_edit_should_not_display_spent_time_custom_field_not_visible
5677
    cf = TimeEntryCustomField.find(10)
5678
    cf.visible = false
5679
    cf.role_ids = [1]
5680
    cf.save!
5681

  
5682
    @request.session[:user_id] = 2
5683

  
5684
    get(
5685
      :edit,
5686
      :params => {
5687
        :id => 13,
5688
      }
5689
    )
5690

  
5691
    assert_response :success
5692

  
5693
    assert_select '#issue-form select.cf_10', 0
5694
  end
5695

  
5661 5696
  def test_update_form_for_existing_issue
5662 5697
    @request.session[:user_id] = 2
5663 5698
    patch(
(9-9/9)