root/platform/tdiary/spec/title_anchor_spec.rb

Revision 5354, 0.9 kB (checked in by hsbt, 10 months ago)

platform/tdiary/spec/title_anchor_spec.rb: fix comment, expected string.

Line 
1$:.unshift(File.dirname(__FILE__))
2require 'spec_helper'
3
4describe "title_anchor plugin" do
5        def setup_title_anchor_plugin(mode)
6                fake_plugin(:title_anchor) { |plugin|
7                        plugin.mode = mode
8                        plugin.conf.index = ''
9                        plugin.conf.html_title = "HsbtDiary"
10                }
11        end
12
13        describe "in day mode" do
14                before do
15                        @plugin = setup_title_anchor_plugin('day')
16                end
17
18                it { @plugin.title_anchor.should  == expected_html_title_in_day(
19                                :index => '',
20                                :html_title => 'HsbtDiary')}
21        end
22
23        describe "in latest mode" do
24                before do
25                        @plugin = setup_title_anchor_plugin('latest')
26                end
27
28                it { @plugin.title_anchor.should  == expected_html_title_in_latest(
29                                :html_title => 'HsbtDiary')}
30        end
31
32        def expected_html_title_in_day(options)
33                expected = %{<h1><a href="#{options[:index]}">#{options[:html_title]}</a></h1>}
34        end
35
36        def expected_html_title_in_latest(options)
37                expected = %{<h1>#{options[:html_title]}</h1>}
38        end
39end
Note: See TracBrowser for help on using the browser.