Project

General

Profile

Defect #33562 ยป fix-unreachable-test-methods.patch

Go MAEDA, 2020-06-06 08:55

View differences:

test/helpers/application_helper_test.rb
1921 1921
    assert_nil render_if_exist(:partial => 'non_exist_partial')
1922 1922
  end
1923 1923

  
1924
  def test_export_csv_encoding_select_tag_should_return_nil_when_general_csv_encoding_is_UTF8
1925
    with_locale 'az' do
1926
      assert_equal l(:general_csv_encoding), 'UTF-8'
1927
      assert_nil export_csv_encoding_select_tag
1928
    end
1929
  end
1930

  
1931
  def test_export_csv_encoding_select_tag_should_have_two_option_when_general_csv_encoding_is_not_UTF8
1932
    with_locale 'en' do
1933
      assert_not_equal l(:general_csv_encoding), 'UTF-8'
1934
      result = export_csv_encoding_select_tag
1935
      assert_select_in result, "option[selected='selected'][value=#{l(:general_csv_encoding)}]", :text => l(:general_csv_encoding)
1936
      assert_select_in result, "option[value='UTF-8']", :text => 'UTF-8'
1937
    end
1938
  end
1939

  
1924 1940
  private
1925 1941

  
1926 1942
  def wiki_links_with_special_characters
......
1951 1967
                  :class => "wiki-page new"),
1952 1968
    }
1953 1969
  end
1954

  
1955
  def test_export_csv_encoding_select_tag_should_return_nil_when_general_csv_encoding_is_UTF8
1956
    with_locale 'az' do
1957
      assert_equal l(:general_csv_encoding), 'UTF-8'
1958
      assert_nil export_csv_encoding_select_tag
1959
    end
1960
  end
1961

  
1962
  def test_export_csv_encoding_select_tag_should_have_two_option_when_general_csv_encoding_is_not_UTF8
1963
    with_locale 'en' do
1964
      assert_not_equal l(:general_csv_encoding), 'UTF-8'
1965
      result = export_csv_encoding_select_tag
1966
      assert_select_in result, "option[selected='selected'][value=#{l(:general_csv_encoding)}]", :text => l(:general_csv_encoding)
1967
      assert_select_in result, "option[value='UTF-8']", :text => 'UTF-8'
1968
    end
1969
  end
1970 1970
end
    (1-1/1)