diff options
Diffstat (limited to 'test/unit/lib/redmine')
8 files changed, 34 insertions, 34 deletions
diff --git a/test/unit/lib/redmine/ciphering_test.rb b/test/unit/lib/redmine/ciphering_test.rb index 79ce7ba42..95b6fb222 100644 --- a/test/unit/lib/redmine/ciphering_test.rb +++ b/test/unit/lib/redmine/ciphering_test.rb @@ -64,7 +64,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase assert_equal 'clear', r.password end end - + def test_ciphered_password_with_no_cipher_key_configured_should_be_returned_ciphered Redmine::Configuration.with 'database_cipher_key' => 'secret' do r = Repository::Subversion.create!(:password => 'clear', :url => 'file:///tmp', :identifier => 'svn') diff --git a/test/unit/lib/redmine/field_format/version_field_format_test.rb b/test/unit/lib/redmine/field_format/version_field_format_test.rb index 2ec405bcf..34eae0a6d 100644 --- a/test/unit/lib/redmine/field_format/version_field_format_test.rb +++ b/test/unit/lib/redmine/field_format/version_field_format_test.rb @@ -73,7 +73,7 @@ class Redmine::VersionFieldFormatTest < ActionView::TestCase assert_equal expected, field.possible_values_options(project).map(&:first) end - + def test_possible_values_options_should_return_system_shared_versions_without_project field = IssueCustomField.new(:field_format => 'version') version = Version.generate!(:project => Project.find(1), :status => 'open', :sharing => 'system') diff --git a/test/unit/lib/redmine/i18n_test.rb b/test/unit/lib/redmine/i18n_test.rb index 170073f68..d795b442c 100644 --- a/test/unit/lib/redmine/i18n_test.rb +++ b/test/unit/lib/redmine/i18n_test.rb @@ -70,7 +70,7 @@ class Redmine::I18nTest < ActiveSupport::TestCase end assert l('date.day_names').is_a?(Array) assert_equal 7, l('date.day_names').size - + assert l('date.month_names').is_a?(Array) assert_equal 13, l('date.month_names').size end diff --git a/test/unit/lib/redmine/menu_manager/menu_helper_test.rb b/test/unit/lib/redmine/menu_manager/menu_helper_test.rb index abe70767c..1c4799dd5 100644 --- a/test/unit/lib/redmine/menu_manager/menu_helper_test.rb +++ b/test/unit/lib/redmine/menu_manager/menu_helper_test.rb @@ -211,7 +211,7 @@ class Redmine::MenuManager::MenuHelperTest < Redmine::HelperTest end end end - + def test_render_empty_virtual_menu_node_with_children # only empty item with no click target diff --git a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb index ad301b6fc..aaa421d3c 100644 --- a/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/git_adapter_test.rb @@ -77,22 +77,22 @@ class GitAdapterTest < ActiveSupport::TestCase end assert_equal 8, brs.length br_issue_8857 = brs[0] - assert_equal 'issue-8857', br_issue_8857.to_s + assert_equal 'issue-8857', br_issue_8857.to_s assert_equal '2a682156a3b6e77a8bf9cd4590e8db757f3c6c78', br_issue_8857.revision assert_equal br_issue_8857.scmid, br_issue_8857.revision assert_equal false, br_issue_8857.is_default br_latin_1_branch1 = brs[1] - assert_equal "latin-1-branch-#{@char_1}-01", br_latin_1_branch1.to_s + assert_equal "latin-1-branch-#{@char_1}-01", br_latin_1_branch1.to_s assert_equal '4fc55c43bf3d3dc2efb66145365ddc17639ce81e', br_latin_1_branch1.revision assert_equal br_latin_1_branch1.scmid, br_latin_1_branch1.revision assert_equal false, br_latin_1_branch1.is_default br_latin_1_branch2 = brs[2] - assert_equal "latin-1-branch-#{@char_1}-02", br_latin_1_branch2.to_s + assert_equal "latin-1-branch-#{@char_1}-02", br_latin_1_branch2.to_s assert_equal '1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127', br_latin_1_branch2.revision assert_equal br_latin_1_branch2.scmid, br_latin_1_branch2.revision assert_equal false, br_latin_1_branch2.is_default br_latin_1_path = brs[3] - assert_equal 'latin-1-path-encoding', br_latin_1_path.to_s + assert_equal 'latin-1-path-encoding', br_latin_1_path.to_s assert_equal '1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127', br_latin_1_path.revision assert_equal br_latin_1_path.scmid, br_latin_1_path.revision assert_equal false, br_latin_1_path.is_default diff --git a/test/unit/lib/redmine/unified_diff_test.rb b/test/unit/lib/redmine/unified_diff_test.rb index 55f475d0c..1879ebf8f 100644 --- a/test/unit/lib/redmine/unified_diff_test.rb +++ b/test/unit/lib/redmine/unified_diff_test.rb @@ -123,13 +123,13 @@ DIFF --- file.c ------------------------- +A line that starts with dashes: - + and removed. - + @@ -23,4 +19,4 @@ - - - + + + -Another chunk of change +Another chunk of changes @@ -360,7 +360,7 @@ DIFF end def test_offset_range_japanese_4 - # UTF-8 The 2nd byte differs. + # UTF-8 The 2nd byte differs. with_settings :repositories_encodings => '' do diff = Redmine::UnifiedDiff.new( read_diff_fixture('issue-13644-4.diff'), :type => 'sbs') @@ -372,7 +372,7 @@ DIFF end def test_offset_range_japanese_5 - # UTF-8 The 2nd byte differs. + # UTF-8 The 2nd byte differs. with_settings :repositories_encodings => '' do diff = Redmine::UnifiedDiff.new( read_diff_fixture('issue-13644-5.diff'), :type => 'sbs') diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb index d6aaedcb1..b91638274 100644 --- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb @@ -89,7 +89,7 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest def test_multiple_macros_on_the_same_line Redmine::WikiFormatting::Macros.macro :foo do |obj, args| - args.any? ? "args: #{args.join(',')}" : "no args" + args.any? ? "args: #{args.join(',')}" : "no args" end assert_equal '<p>no args no args</p>', textilizable("{{foo}} {{foo}}") @@ -212,7 +212,7 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest text = "{{collapse\n*Collapsed* block of text\n}}" with_locale 'en' do result = textilizable(text) - + assert_select_in result, 'div.collapsed-text' assert_select_in result, 'strong', :text => 'Collapsed' assert_select_in result, 'a.collapsible.collapsed', :text => 'Show' @@ -249,7 +249,7 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest h1. Title {{collapse(Show example, Hide example) -h2. Heading +h2. Heading }}" RAW diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb index ee5d1b49e..671a5b384 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -281,7 +281,7 @@ EXPECTED This is a table with trailing whitespace in one row: |cell11|cell12| -|cell21|cell22| +|cell21|cell22| |cell31|cell32| RAW @@ -383,8 +383,8 @@ EXPECTED expected = '<p><img src="/images/comment.png"onclick=&#x61;&#x6c;&#x65;&#x72;&#x74;&#x28;&#x27;&#x58;&#x53;&#x53;&#x27;&#x29;;&#x22;" alt="" /></p>' assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '') end - - + + STR_WITHOUT_PRE = [ # 0 "h1. Title @@ -414,36 +414,36 @@ Praesent eget turpis nibh, a lacinia nulla.", Ut rhoncus elementum adipiscing."] TEXT_WITHOUT_PRE = STR_WITHOUT_PRE.join("\n\n").freeze - + def test_get_section_should_return_the_requested_section_and_its_hash assert_section_with_hash STR_WITHOUT_PRE[1], TEXT_WITHOUT_PRE, 2 assert_section_with_hash STR_WITHOUT_PRE[2..3].join("\n\n"), TEXT_WITHOUT_PRE, 3 assert_section_with_hash STR_WITHOUT_PRE[3], TEXT_WITHOUT_PRE, 5 assert_section_with_hash STR_WITHOUT_PRE[4], TEXT_WITHOUT_PRE, 6 - + assert_section_with_hash '', TEXT_WITHOUT_PRE, 0 assert_section_with_hash '', TEXT_WITHOUT_PRE, 10 end - + def test_update_section_should_update_the_requested_section replacement = "New text" - + assert_equal [STR_WITHOUT_PRE[0], replacement, STR_WITHOUT_PRE[2..4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(2, replacement) assert_equal [STR_WITHOUT_PRE[0..1], replacement, STR_WITHOUT_PRE[4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(3, replacement) assert_equal [STR_WITHOUT_PRE[0..2], replacement, STR_WITHOUT_PRE[4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(5, replacement) assert_equal [STR_WITHOUT_PRE[0..3], replacement].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(6, replacement) - + assert_equal TEXT_WITHOUT_PRE, @formatter.new(TEXT_WITHOUT_PRE).update_section(0, replacement) assert_equal TEXT_WITHOUT_PRE, @formatter.new(TEXT_WITHOUT_PRE).update_section(10, replacement) end - + def test_update_section_with_hash_should_update_the_requested_section replacement = "New text" - + assert_equal [STR_WITHOUT_PRE[0], replacement, STR_WITHOUT_PRE[2..4]].flatten.join("\n\n"), @formatter.new(TEXT_WITHOUT_PRE).update_section(2, replacement, Digest::MD5.hexdigest(STR_WITHOUT_PRE[1])) end - + def test_update_section_with_wrong_hash_should_raise_an_error assert_raise Redmine::WikiFormatting::StaleSectionError do @formatter.new(TEXT_WITHOUT_PRE).update_section(2, "New text", Digest::MD5.hexdigest("Old text")) @@ -494,7 +494,7 @@ Nulla nunc nisi, egestas in ornare vel, posuere ac libero."] def test_update_section_should_not_escape_pre_content_outside_section text = STR_WITH_PRE.join("\n\n") replacement = "New text" - + assert_equal [STR_WITH_PRE[0..1], "New text"].flatten.join("\n\n"), @formatter.new(text).update_section(3, replacement) end @@ -509,13 +509,13 @@ Content 1 h1. Heading 2 Content 2 - + h1. Heading 3 Content 3 h1. Heading 4 - + Content 4 STR @@ -633,10 +633,10 @@ EXPECTED def to_html(text) @formatter.new(text).to_html end - + def assert_section_with_hash(expected, text, index) result = @formatter.new(text).get_section(index) - + assert_kind_of Array, result assert_equal 2, result.size assert_equal expected, result.first, "section content did not match" |