Sha256: f2ef1b87fcaa42afb3f5a178117f27c327d88594ef5f14b2bbd8e7b59f378542

Contents?: true

Size: 1007 Bytes

Versions: 46

Compression:

Stored size: 1007 Bytes

Contents

$:.unshift(File.dirname(__FILE__))
require 'spec_helper'

describe "apple_webclip plugin" do
	def setup_apple_webclip_plugin( url )
		fake_plugin(:apple_webclip) { |plugin|
			plugin.conf['apple_webclip.url'] = url
		}
	end

	describe "url is enabled" do
		before do
			plugin = setup_apple_webclip_plugin('http://example.com/example.png')
			@header_snippet = plugin.header_proc
		end

		it "header include url" do
			expect(@header_snippet).to eq(%Q|\t<link rel="apple-touch-icon" href="http://example.com/example.png">|)
		end
	end

	describe "url is disabled" do
		describe "url is empty" do
			before do
				plugin = setup_apple_webclip_plugin('')
				@header_snippet = plugin.header_proc
			end

			it "header is empty" do
				expect(@header_snippet).to be_empty
			end
		end

		describe "url is nil" do
			before do
				plugin = setup_apple_webclip_plugin(nil)
				@header_snippet = plugin.header_proc
			end

			it "header is empty" do
				expect(@header_snippet).to be_empty
			end
		end
	end

end

Version data entries

46 entries across 40 versions & 2 rubygems

Version Path
tdiary-contrib-5.3.0 spec/apple_webclip_spec.rb
tdiary-contrib-5.2.4 spec/apple_webclip_spec.rb
tdiary-contrib-5.2.3 spec/apple_webclip_spec.rb
tdiary-contrib-5.2.2 spec/apple_webclip_spec.rb
tdiary-contrib-5.2.1 spec/apple_webclip_spec.rb
tdiary-contrib-5.2.0 spec/apple_webclip_spec.rb
tdiary-contrib-5.1.7 spec/apple_webclip_spec.rb
tdiary-contrib-5.1.6 spec/apple_webclip_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-contrib-5.1.4/spec/apple_webclip_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/bundler/gems/tdiary-contrib-d1e41204db13/spec/apple_webclip_spec.rb
tdiary-contrib-5.1.5 spec/apple_webclip_spec.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-contrib-5.1.4/spec/apple_webclip_spec.rb
tdiary-contrib-5.1.4 spec/apple_webclip_spec.rb
tdiary-contrib-5.1.3 spec/apple_webclip_spec.rb
tdiary-contrib-5.1.2 spec/apple_webclip_spec.rb
tdiary-contrib-5.1.1 spec/apple_webclip_spec.rb
tdiary-contrib-5.1.0 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.13 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.12 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.11 spec/apple_webclip_spec.rb