Sha256: 4e108ab16cdaeefc1337353c92f4d31a91b939a8467b8280928daf7861f56c06

Contents?: true

Size: 824 Bytes

Versions: 62

Compression:

Stored size: 824 Bytes

Contents

require 'test_helper'

module Workarea
  class ConditionalUrlHelperTest < ViewTest
    def test_link_to_if_with_block
      result = link_to_if_with_block(true, 'www.example.com', {}) do
        "Block body"
      end
      assert_equal("<a href=\"www.example.com\">Block body</a>", result)

      result = link_to_if_with_block(false, 'www.example.com', {}) do
        "Block body"
      end
      assert_equal("Block body", result)
    end

    def test_link_to_unless_with_block
      result = link_to_unless_with_block(true, 'www.example.com', {}) do
        "Block body"
      end
      assert_equal("Block body", result)

      result = link_to_unless_with_block(false, 'www.example.com', {}) do
        "Block body"
      end
      assert_equal("<a href=\"www.example.com\">Block body</a>", result)
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.26 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.45 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.25 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.23 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.44 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.22 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.43 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.21 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.42 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.20 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.41 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.19 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.40 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.18 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.39 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.17 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.38 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.16 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.37 test/helpers/workarea/conditional_url_helper_test.rb