0002-Reorder-and-rename-test-added-in-32959.patch

Marius BALTEANU, 2020-02-09 15:21

Download (1.69 KB)

View differences:

test/functional/timelog_controller_test.rb
208 208
    end
209 209
  end
210 210

  
211
  def test_get_edit_for_other_user
212
    Role.find_by_name('Manager').add_permission! :log_time_for_other_users
213
    @request.session[:user_id] = 2
214

  
215
    get :edit, :params => {
216
      :id => 1
217
    }
218

  
219
    assert_response :success
220

  
221
    assert_select 'select[name=?]', 'time_entry[user_id]' do
222
      assert_select 'option[value="2"][selected=selected]'
223
    end
224
  end
225

  
211 226
  def test_post_create
212 227
    @request.session[:user_id] = 3
213 228
    assert_difference 'TimeEntry.count' do
......
1500 1515
    assert_response :success
1501 1516
    assert_select "td.issue_cf_#{field.id}", :text => 'This is a long text'
1502 1517
  end
1503

  
1504
  def test_edit_for_other_user
1505
    Role.find_by_name('Manager').add_permission! :log_time_for_other_users
1506
    @request.session[:user_id] = 2
1507

  
1508
    get :edit, :params => {
1509
      :id => 1
1510
    }
1511

  
1512
    assert_response :success
1513

  
1514
    assert_select 'select[name=?]', 'time_entry[user_id]' do
1515
      assert_select 'option[value="2"][selected=selected]'
1516
    end
1517
  end
1518 1518
end
1519
-