Sha256: 8316889d93096089b5d35f9a5a31f8282828d63c98d969c85d327d3c11511603

Contents?: true

Size: 597 Bytes

Versions: 7

Compression:

Stored size: 597 Bytes

Contents

# -*- encoding : utf-8 -*-
describe Card::Set::All::Links do
  require "card"
  describe "#link_to_resource" do
    it "opens external link in new tab" do
      actual = Card["Home"].format.link_to_resource "http://example.com"
      expected = 'a[class="external-link"][target="_blank"]' \
                 '[href="http://example.com"]'
      assert_view_select actual, expected
    end

    it "opens interal link in same tab" do
      actual = Card["Home"].format.link_to_resource "/Home"
      expected = 'a[target="_blank"]'
      assert_view_select actual, expected, false
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
card-1.20.4 mod/standard/spec/set/all/links_spec.rb
card-1.20.3 mod/standard/spec/set/all/links_spec.rb
card-1.20.2 mod/standard/spec/set/all/links_spec.rb
card-1.20.1 mod/standard/spec/set/all/links_spec.rb
card-1.20.0 mod/standard/spec/set/all/links_spec.rb
card-1.19.6 mod/standard/spec/set/all/links_spec.rb
card-1.19.5 mod/standard/spec/set/all/links_spec.rb