Sha256: 4ceb49ddd3ec12eea86641679416553ccddd4599761461a167ccd496dffb84fe

Contents?: true

Size: 1.21 KB

Versions: 72

Compression:

Stored size: 1.21 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>)
    expect(tel_link("+ 33 6")).to eq %(<a href="tel:+336">+ 33 6</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

72 entries across 72 versions & 1 rubygems

Version Path
dorsale-3.4.0 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.3.0 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.2.0 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.1.7 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.1.6 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.1.5 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.1.4 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.1.3 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.1.2 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.1.1 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.1.0 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.0.3 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.0.2 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.0.1 spec/helpers/dorsale/link_helper_spec.rb
dorsale-3.0.0 spec/helpers/dorsale/link_helper_spec.rb
dorsale-2.7.3 spec/helpers/dorsale/link_helper_spec.rb
dorsale-2.7.2 spec/helpers/dorsale/link_helper_spec.rb
dorsale-2.7.1 spec/helpers/dorsale/link_helper_spec.rb
dorsale-2.7.0 spec/helpers/dorsale/link_helper_spec.rb
dorsale-2.6.8 spec/helpers/dorsale/link_helper_spec.rb