Changeset 5278 for platform/tdiary/spec
- Timestamp:
- 01/22/08 16:42:56 (10 months ago)
- Files:
-
- 1 modified
-
platform/tdiary/spec/account_ad_spec.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/spec/account_ad_spec.rb
r5178 r5278 1 1 $:.unshift(File.dirname(__FILE__)) 2 2 require 'spec_helper' 3 require 'time' 3 4 4 5 describe "account_ad plugin w/" do 5 def setup_account_ad_plugin(service, name )6 def setup_account_ad_plugin(service, name, mode) 6 7 fake_plugin(:account_ad) { |plugin| 7 plugin.mode = 'latest'8 plugin.mode = mode 8 9 plugin.conf['account.service'] = service 9 10 plugin.conf['account.name'] = name 10 11 plugin.conf['base_url'] = 'http://www.hsbt.org/diary/' 12 plugin.date = Time.parse("20070120") 11 13 } 12 14 end 13 15 14 describe "Hatena " do16 describe "Hatena in day mode" do 15 17 before do 16 plugin = setup_account_ad_plugin('Hatena', 'hsbt' )18 plugin = setup_account_ad_plugin('Hatena', 'hsbt', 'day') 17 19 @header_snippet = plugin.header_proc 18 20 end 21 22 it { @header_snippet.should include_description_about_with( 23 :permalink => 'http://www.hsbt.org/diary/?date=20070120')} 19 24 20 25 it { @header_snippet.should include_account_service_with( … … 23 28 it { @header_snippet.should include_account_name_with( 24 29 :name => 'hsbt')} 30 end 25 31 32 describe "Hatena in latest mode" do 33 before do 34 plugin = setup_account_ad_plugin('Hatena', 'hsbt', 'latest') 35 @header_snippet = plugin.header_proc 36 end 37 38 it { @header_snippet.should include_description_about_with( 39 :permalink => 'http://www.hsbt.org/diary/')} 40 41 it { @header_snippet.should include_account_service_with( 42 :service => 'http://www.hatena.ne.jp/')} 43 44 it { @header_snippet.should include_account_name_with( 45 :name => 'hsbt')} 46 end 47 48 def include_description_about_with(options) 49 msg = "include #{options[:permalink]}" 50 expected = %|<rdf:Description rdf:about="#{options[:permalink]}">| 51 Spec::Matchers::SimpleMatcher.new(msg) do |actual| 52 actual.include?(expected) 53 end 26 54 end 27 55
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)