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.0.10 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.9 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.8 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.7 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.6 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.5 spec/apple_webclip_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/spec/apple_webclip_spec.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-fa9c20aa0d97/spec/apple_webclip_spec.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/spec/apple_webclip_spec.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-a3c5f37278c4/spec/apple_webclip_spec.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-f08988dfa0f6/spec/apple_webclip_spec.rb
tdiary-contrib-5.0.4 spec/apple_webclip_spec.rb
tdiary-5.0.4 vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/spec/apple_webclip_spec.rb
tdiary-contrib-5.0.3 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.2 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.1 spec/apple_webclip_spec.rb
tdiary-contrib-5.0.0 spec/apple_webclip_spec.rb
tdiary-contrib-4.2.1 spec/apple_webclip_spec.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/bundler/gems/tdiary-contrib-d189eb6688f1/spec/apple_webclip_spec.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/bundler/gems/tdiary-contrib-2ab36447ae2a/spec/apple_webclip_spec.rb