Sha256: de073a81f935f7ba45d7d84d46f5dcde60879caed54ad07e4846e349b38375a2

Contents?: true

Size: 717 Bytes

Versions: 2

Compression:

Stored size: 717 Bytes

Contents

require 'spec_helper'

describe Rails::SmartAppBanner::Helper do
  let(:banner_helper) { SmartAppBannerHelperStub.new }
  let(:id) { "389801252" }

  it "should return a correct tag with an app id" do
    output = "<meta name=\"apple-itunes-app\" content=\"app-id=389801252\">"
    expect(banner_helper.smart_app_banner(id)).to eq(output)
  end

  it "should allow arguments" do
    output = "<meta name=\"apple-itunes-app\" content=\"app-id=389801252, affiliate-data=foobar\">"
    input = banner_helper.smart_app_banner(id, { affiliate_data: 'foobar' })
    expect(input).to eq(output)
  end

  it "should fail without an id" do
    expect {
      banner_helper.smart_app_banner(nil)
    }.to raise_error
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smart-app-banner-0.0.2 spec/smart_app_banner_spec.rb
smart-app-banner-0.0.1 spec/smart_app_banner_spec.rb