Project

General

Profile

Defect #44692 » 0001-Fix-ApplicationHelperTest-test_wiki_textarea_stimulu.patch

Marius BĂLTEANU, 2026-10-28 23:19

View differences:

test/helpers/application_helper_test.rb
2504 2504
    assert_equal '', result
2505 2505
  end
2506 2506

  
2507
  def test_wiki_textarea_stimulus_attributes
2508
    with_settings :text_formatting => 'textile' do
2509
      expected = {
2510
        controller: "list-autofill selection-indent table-paste",
2511
        action: "beforeinput->list-autofill#handleBeforeInput keydown.tab->selection-indent#run " \
2512
                "keydown.shift+tab->selection-indent#run paste->table-paste#handlePaste",
2513
        list_autofill_text_formatting_param: "textile",
2514
        selection_indent_text_formatting_param: "textile",
2515
        table_paste_text_formatting_param: "textile"
2516
      }
2517

  
2518
      assert_equal expected, wiki_textarea_stimulus_attributes
2519
    end
2520
  end
2521

  
2522
  def test_wiki_textarea_stimulus_attributes_with_blank_text_formatting
2523
    with_settings :text_formatting => '' do
2524
      assert_equal({}, wiki_textarea_stimulus_attributes)
2525
    end
2526
  end
2527

  
2507 2528
  private
2508 2529

  
2509 2530
  def wiki_links_with_special_characters
......
2534 2555
                  :class => "wiki-page new"),
2535 2556
    }
2536 2557
  end
2537

  
2538
  def test_wiki_textarea_stimulus_attributes
2539
    with_settings :text_formatting => 'textile' do
2540
      expected = {
2541
        controller: "list-autofill table-paste",
2542
        action: "beforeinput->list-autofill#handleBeforeInput paste->table-paste#handlePaste",
2543
        list_autofill_text_formatting_param: "textile",
2544
        table_paste_text_formatting_param: "textile"
2545
      }
2546

  
2547
      assert_equal expected, wiki_textarea_stimulus_attributes
2548
    end
2549
  end
2550

  
2551
  def test_wiki_textarea_stimulus_attributes_with_blank_text_formatting
2552
    with_settings :text_formatting => '' do
2553
      assert_equal({}, wiki_textarea_stimulus_attributes)
2554
    end
2555
  end
2556 2558
end
    (1-1/1)