Project

General

Profile

Defect #28264 » tests_for_28264.patch

Marius BĂLTEANU, 2018-02-28 23:07

View differences:

test/functional/issues_controller_test.rb
455 455
    assert_equal 1, session[:issue_query][:project_id]
456 456
  end
457
  def test_index_with_global_public_query_id_should_not_show_edit_delete_links_for_non_admin_users
458
    @request.session[:user_id] = 2
459

  
460
    get :index, :params => {
461
        :project_id => 1,
462
        :query_id => 4
463
      }
464

  
465
    assert_response :success
466
    assert_select '#query_form_with_buttons > p.buttons' do
467
      assert_select 'a.icon-edit', 0
468
      assert_select 'a.icon-delete', 0
469
    end
470
  end
471

  
457 472
  def test_index_with_invalid_query_id_should_respond_404
458 473
    get :index, :params => {
459 474
        :project_id => 1,
test/functional/queries_controller_test.rb
436 436
    assert_select 'input[name=query_is_for_all][type=checkbox][checked=checked]'
437 437
  end
438
  def test_edit_global_public_query_should_not_be_allowed_for_non_admin_users
439
    @request.session[:user_id] = 2
440
    get :edit, :params => {
441
        :id => 4
442
      }
443
    assert_response 403
444
  end
445

  
438 446
  def test_edit_global_private_query
439 447
    @request.session[:user_id] = 3
440 448
    get :edit, :params => {
(1-1/3)