Sha256: a001ef2bea38110ecf1fa6e04aff85c175c06f2fb45e2ac67e3c3d8332000a56

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

require 'rails_helper'

describe Dorsale::LinkHelper, type: :helper do
  it "web_link" do
    expect(web_link("")).to be nil
    expect(web_link(nil)).to be nil
    expect(web_link("google.fr")).to eq %(<a href="http://google.fr">google.fr</a>)
    expect(web_link("http://google.fr")).to eq %(<a href="http://google.fr">http://google.fr</a>)
  end

  it "tel_link" do
    expect(tel_link("")).to be nil
    expect(tel_link(nil)).to be nil
    expect(tel_link("123")).to eq %(<a href="tel:123">123</a>)
  end

  it "email_link" do
    expect(email_link("")).to be nil
    expect(email_link(nil)).to be nil
    expect(email_link("aaa@bbb.com")).to eq %(<a href="mailto:aaa@bbb.com">aaa@bbb.com</a>)
  end

  it "twitter_link" do
    expect(twitter_link("")).to be nil
    expect(twitter_link(nil)).to be nil
    expect(twitter_link("BenoitMC")).to eq %(<a href="https://twitter.com/BenoitMC">BenoitMC</a>)
    expect(twitter_link("twitter.com/BenoitMC")).to eq %(<a href="https://twitter.com/BenoitMC">twitter.com/BenoitMC</a>)
    expect(twitter_link("http://twitter.com/BenoitMC")).to eq %(<a href="http://twitter.com/BenoitMC">http://twitter.com/BenoitMC</a>)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dorsale-1.2.6 spec/helpers/dorsale/link_helper_spec.rb
dorsale-1.2.5 spec/helpers/dorsale/link_helper_spec.rb
dorsale-1.2.4 spec/helpers/dorsale/link_helper_spec.rb
dorsale-1.2.3 spec/helpers/dorsale/link_helper_spec.rb