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.15 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.36 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.14 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.35 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.13 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.34 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.12 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.33 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.11 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.10 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.32 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.9 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.31 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.8 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.30 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.7 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.29 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.6 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.4.28 test/helpers/workarea/conditional_url_helper_test.rb
workarea-core-3.5.5 test/helpers/workarea/conditional_url_helper_test.rb