Project

General

Profile

Defect #33341 » 0001-Fix-time-entry-user-is-shown-twice-in-the-User-drop-.patch

Marius BĂLTEANU, 2020-04-26 18:51

View differences:

app/helpers/timelog_helper.rb
44 44

  
45 45
  def user_collection_for_select_options(time_entry)
46 46
    collection = time_entry.assignable_users
47
    collection << time_entry.user unless time_entry.user.nil? && !collection.include?(time_entry.user)
47
    collection << time_entry.user if time_entry.user && !collection.include?(time_entry.user)
48 48
    principals_options_for_select(collection, time_entry.user_id.to_s)
49 49
  end
50 50

  
test/functional/timelog_controller_test.rb
226 226
    assert_response :success
227 227

  
228 228
    assert_select 'select[name=?]', 'time_entry[user_id]' do
229
      assert_select 'option[value="2"][selected=selected]'
229
      assert_select 'option[value="2"][selected=selected]', 1
230 230
    end
231 231
  end
232 232

  
(3-3/3)