tdiary 4.0.2 → 4.0.2.20140201
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/Gemfile +8 -7
- data/Gemfile.lock +17 -15
- data/config.ru +0 -2
- data/doc/INSTALL-paas.md +17 -5
- data/misc/plugin/amazon/amazonimg.rb +1 -1
- data/misc/plugin/category.rb +7 -7
- data/misc/plugin/image.rb +4 -1
- data/misc/plugin/search-default.rb +269 -0
- data/misc/theme_convert/theme_convert.rb +3 -3
- data/plugin/50sp.rb +3 -2
- data/spec/acceptance/append_comment_spec.rb +8 -8
- data/spec/acceptance/append_diary_spec.rb +9 -9
- data/spec/acceptance/save_conf_comment_spec.rb +7 -7
- data/spec/acceptance/save_conf_default_spec.rb +31 -31
- data/spec/acceptance/save_conf_dnsbl_spec.rb +28 -28
- data/spec/acceptance/save_conf_referer_spec.rb +6 -6
- data/spec/acceptance/save_conf_security_spec.rb +37 -37
- data/spec/acceptance/support/helpers.rb +8 -8
- data/spec/acceptance/update_diary_spec.rb +21 -21
- data/spec/acceptance/view_category_spec.rb +5 -5
- data/spec/acceptance/view_comment_spec.rb +6 -6
- data/spec/acceptance/view_diary_spec.rb +12 -12
- data/spec/acceptance/view_referer_spec.rb +3 -3
- data/spec/acceptance_helper.rb +2 -2
- data/spec/core/configuration_spec.rb +1 -1
- data/spec/core/io/default_spec.rb +30 -2
- data/spec/core/plugin_spec.rb +1 -1
- data/tdiary/application/configuration.rb +0 -1
- data/tdiary/application/extensions/omniauth.rb +1 -1
- data/tdiary/application.rb +6 -9
- data/tdiary/cli.rb +6 -6
- data/tdiary/configuration.rb +2 -2
- data/tdiary/extensions/core.rb +18 -0
- data/tdiary/extensions.rb +6 -0
- data/tdiary/io/base.rb +11 -7
- data/tdiary/lang/ja.rb +2 -2
- data/tdiary/server.rb +1 -1
- data/tdiary/version.rb +1 -1
- data/tdiary.rb +2 -1
- data/test/test_plugin_helper.rb +54 -10
- data/test/test_plugin_helper_test.rb +27 -5
- data/test/weather_test.rb +26 -22
- data/tmp/.gitkeep +0 -0
- metadata +7 -3
@@ -8,9 +8,9 @@ feature '日記の追記' do
|
|
8
8
|
page.should have_content('日記の更新')
|
9
9
|
|
10
10
|
y, m, d = Date.today.to_s.split('-').map {|t| t.sub(/^0+/, "") }
|
11
|
-
within('span.year') { page.should have_field('year', :
|
12
|
-
within('span.month') { page.should have_field('month', :
|
13
|
-
within('span.day') { page.should have_field('day', :
|
11
|
+
within('span.year') { page.should have_field('year', with: y) }
|
12
|
+
within('span.month') { page.should have_field('month', with: m) }
|
13
|
+
within('span.day') { page.should have_field('day', with: d) }
|
14
14
|
end
|
15
15
|
|
16
16
|
scenario '今日の日記を書く' do
|
@@ -23,7 +23,7 @@ feature '日記の追記' do
|
|
23
23
|
page.should have_content "とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P"
|
24
24
|
}
|
25
25
|
today = Date.today.strftime('%Y年%m月%d日')
|
26
|
-
page.find('h2', :
|
26
|
+
page.find('h2', text: today).click_link today
|
27
27
|
within('div.day span.title'){ page.should have_content "tDiaryのテスト" }
|
28
28
|
within('div.day div.section'){
|
29
29
|
within('h3') { page.should have_content "さて、テストである。" }
|
@@ -35,7 +35,7 @@ feature '日記の追記' do
|
|
35
35
|
append_default_diary('2001-04-23')
|
36
36
|
|
37
37
|
visit '/'
|
38
|
-
page.find('h2', :
|
38
|
+
page.find('h2', text: '2001年04月23日').click_link '2001年04月23日'
|
39
39
|
within('div.day span.title'){ page.should have_content "tDiaryのテスト" }
|
40
40
|
within('div.day div.section'){
|
41
41
|
within('h3') { page.should have_content "さて、テストである。" }
|
@@ -48,9 +48,9 @@ feature '日記の追記' do
|
|
48
48
|
|
49
49
|
visit '/'
|
50
50
|
click_link '追記'
|
51
|
-
within('div.title') { fill_in "title", :
|
51
|
+
within('div.title') { fill_in "title", with: "Hikiのテスト" }
|
52
52
|
within('div.textarea') {
|
53
|
-
fill_in "body", :
|
53
|
+
fill_in "body", with: <<-BODY
|
54
54
|
!さて、Hikiのテストである。
|
55
55
|
とみせかけてtDiary:-)
|
56
56
|
BODY
|
@@ -72,9 +72,9 @@ BODY
|
|
72
72
|
scenario '日記のプレビュー' do
|
73
73
|
visit '/'
|
74
74
|
click_link '追記'
|
75
|
-
within('div.title') { fill_in "title", :
|
75
|
+
within('div.title') { fill_in "title", with: "tDiaryのテスト" }
|
76
76
|
within('div.textarea') {
|
77
|
-
fill_in "body", :
|
77
|
+
fill_in "body", with: <<-BODY
|
78
78
|
!さて、テストである。
|
79
79
|
とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P
|
80
80
|
BODY
|
@@ -7,7 +7,7 @@ feature 'ツッコミ設定の利用' do
|
|
7
7
|
append_default_comment
|
8
8
|
|
9
9
|
visit '/update.rb?conf=comment'
|
10
|
-
select '非表示', :
|
10
|
+
select '非表示', from: 'show_comment'
|
11
11
|
|
12
12
|
page.all('div.saveconf').first.click_button "OK"
|
13
13
|
# within('title') { page.should have_content('(設定完了)') }
|
@@ -26,8 +26,8 @@ feature 'ツッコミ設定の利用' do
|
|
26
26
|
|
27
27
|
visit "/"
|
28
28
|
click_link 'ツッコミを入れる'
|
29
|
-
fill_in "name", :
|
30
|
-
fill_in "body", :
|
29
|
+
fill_in "name", with: "bravo"
|
30
|
+
fill_in "body", with: <<-BODY
|
31
31
|
こんばんは!こんばんは!
|
32
32
|
BODY
|
33
33
|
|
@@ -35,7 +35,7 @@ BODY
|
|
35
35
|
page.should have_content "Click here!"
|
36
36
|
|
37
37
|
visit '/update.rb?conf=comment'
|
38
|
-
fill_in 'comment_limit', :
|
38
|
+
fill_in 'comment_limit', with: '1'
|
39
39
|
|
40
40
|
page.all('div.saveconf').first.click_button "OK"
|
41
41
|
# within('title') { page.should have_content('(設定完了)') }
|
@@ -49,7 +49,7 @@ BODY
|
|
49
49
|
}
|
50
50
|
|
51
51
|
today = Date.today.strftime('%Y年%m月%d日')
|
52
|
-
page.find('h2', :
|
52
|
+
page.find('h2', text: today).click_link today
|
53
53
|
within('div.day div.comment div.commentbody') {
|
54
54
|
page.should have_content "alpha"
|
55
55
|
page.should have_content "bravo"
|
@@ -63,14 +63,14 @@ BODY
|
|
63
63
|
append_default_comment
|
64
64
|
|
65
65
|
visit '/update.rb?conf=comment'
|
66
|
-
fill_in 'comment_limit_per_day', :
|
66
|
+
fill_in 'comment_limit_per_day', with: '1'
|
67
67
|
|
68
68
|
page.all('div.saveconf').first.click_button "OK"
|
69
69
|
# within('title') { page.should have_content('(設定完了)') }
|
70
70
|
|
71
71
|
click_link '最新'
|
72
72
|
today = Date.today.strftime('%Y年%m月%d日')
|
73
|
-
page.find('h2', :
|
73
|
+
page.find('h2', text: today).click_link today
|
74
74
|
within('div#comment-form-section') {
|
75
75
|
within('div.caption') { page.should have_content('本日の日記はツッコミ数の制限を越えています。') }
|
76
76
|
page.should have_no_css('form')
|
@@ -4,14 +4,14 @@ require 'acceptance_helper'
|
|
4
4
|
feature '基本設定の利用' do
|
5
5
|
scenario 'サイトの情報の設定' do
|
6
6
|
visit '/update.rb?conf=default'
|
7
|
-
fill_in "author_name", :
|
8
|
-
fill_in "html_title", :
|
9
|
-
fill_in "author_mail", :
|
10
|
-
fill_in "index_page", :
|
11
|
-
fill_in "description", :
|
12
|
-
fill_in "icon", :
|
7
|
+
fill_in "author_name", with: "ただただし"
|
8
|
+
fill_in "html_title", with: "ただの日記"
|
9
|
+
fill_in "author_mail", with: "t@tdtds.jp"
|
10
|
+
fill_in "index_page", with: "http://www.example.com"
|
11
|
+
fill_in "description", with: "ただただしによる日々の記録"
|
12
|
+
fill_in "icon", with: "http://tdtds.jp/favicon.png"
|
13
13
|
# TODO banner の値が fill_in されない
|
14
|
-
#fill_in "banner", :
|
14
|
+
#fill_in "banner", with: "http://sho.tdiary.net/images/banner.png"
|
15
15
|
# TODO x_frame_open の設定
|
16
16
|
|
17
17
|
page.all('div.saveconf').first.click_button "OK"
|
@@ -22,24 +22,24 @@ feature '基本設定の利用' do
|
|
22
22
|
# within('title') { page.should have_content('ただの日記') }
|
23
23
|
|
24
24
|
visit '/update.rb?conf=default'
|
25
|
-
page.should have_field "author_name", :
|
26
|
-
page.should have_field "html_title", :
|
27
|
-
page.should have_field "author_mail", :
|
28
|
-
page.should have_field "index_page", :
|
29
|
-
page.should have_field "description", :
|
30
|
-
page.should have_field "icon", :
|
25
|
+
page.should have_field "author_name", with: "ただただし"
|
26
|
+
page.should have_field "html_title", with: "ただの日記"
|
27
|
+
page.should have_field "author_mail", with: "t@tdtds.jp"
|
28
|
+
page.should have_field "index_page", with: "http://www.example.com"
|
29
|
+
page.should have_field "description", with: "ただただしによる日々の記録"
|
30
|
+
page.should have_field "icon", with: "http://tdtds.jp/favicon.png"
|
31
31
|
# TODO banner の値が fill_in されない
|
32
|
-
# page.should have_field("banner", :
|
32
|
+
# page.should have_field("banner", with: "http://sho.tdiary.net/images/banner.png")
|
33
33
|
end
|
34
34
|
|
35
35
|
scenario 'ヘッダ・フッタの設定' do
|
36
36
|
visit '/update.rb?conf=header'
|
37
|
-
fill_in "header", :
|
37
|
+
fill_in "header", with: <<-HEADER
|
38
38
|
<%= navi %>
|
39
39
|
<h1>alpha</h1>
|
40
40
|
<div class="main">
|
41
41
|
HEADER
|
42
|
-
fill_in "footer", :
|
42
|
+
fill_in "footer", with: <<-FOOTER
|
43
43
|
</div>
|
44
44
|
<div class="sidebar">
|
45
45
|
bravo
|
@@ -53,12 +53,12 @@ FOOTER
|
|
53
53
|
within('div.sidebar') { page.should have_content('bravo')}
|
54
54
|
|
55
55
|
visit '/update.rb?conf=header'
|
56
|
-
page.should have_field "header", :
|
56
|
+
page.should have_field "header", with: <<-HEADER
|
57
57
|
<%= navi %>
|
58
58
|
<h1>alpha</h1>
|
59
59
|
<div class="main">
|
60
60
|
HEADER
|
61
|
-
page.should have_field "footer", :
|
61
|
+
page.should have_field "footer", with: <<-FOOTER
|
62
62
|
</div>
|
63
63
|
<div class="sidebar">
|
64
64
|
bravo
|
@@ -75,11 +75,11 @@ FOOTER
|
|
75
75
|
append_default_comment
|
76
76
|
|
77
77
|
visit '/update.rb?conf=display'
|
78
|
-
fill_in 'section_anchor', :
|
79
|
-
fill_in 'comment_anchor', :
|
80
|
-
fill_in 'date_format', :
|
81
|
-
fill_in 'latest_limit', :
|
82
|
-
select '非表示', :
|
78
|
+
fill_in 'section_anchor', with: '<span class="sanchor">★</span>'
|
79
|
+
fill_in 'comment_anchor', with: '<span class="canchor">●</span>'
|
80
|
+
fill_in 'date_format', with: '%Y:%m:%d'
|
81
|
+
fill_in 'latest_limit', with: 1
|
82
|
+
select '非表示', from: 'show_nyear'
|
83
83
|
|
84
84
|
page.all('div.saveconf').first.click_button "OK"
|
85
85
|
# within('title') { page.should have_content('(設定完了)') }
|
@@ -95,7 +95,7 @@ FOOTER
|
|
95
95
|
|
96
96
|
scenario 'ログレベルの選択の設定' do
|
97
97
|
visit '/update.rb?conf=logger'
|
98
|
-
select 'DEBUG', :
|
98
|
+
select 'DEBUG', from: 'log_level'
|
99
99
|
|
100
100
|
page.all('div.saveconf').first.click_button "OK"
|
101
101
|
# within('title') { page.should have_content('(設定完了)') }
|
@@ -109,25 +109,25 @@ FOOTER
|
|
109
109
|
|
110
110
|
scenario '時差調整が保存される' do
|
111
111
|
visit '/update.rb?conf=timezone'
|
112
|
-
fill_in 'hour_offset', :
|
112
|
+
fill_in 'hour_offset', with: '-24'
|
113
113
|
|
114
114
|
page.all('div.saveconf').first.click_button "OK"
|
115
115
|
# within('title') { page.should have_content('(設定完了)') }
|
116
116
|
|
117
117
|
click_link '追記'
|
118
118
|
y, m, d = (Date.today - 1).to_s.split('-').map {|t| t.sub(/^0+/, "") }
|
119
|
-
within('span.year') { page.should have_field('year', :
|
120
|
-
within('span.month') { page.should have_field('month', :
|
121
|
-
within('span.day') { page.should have_field('day', :
|
119
|
+
within('span.year') { page.should have_field('year', with: y) }
|
120
|
+
within('span.month') { page.should have_field('month', with: m) }
|
121
|
+
within('span.day') { page.should have_field('day', with: d) }
|
122
122
|
|
123
123
|
click_link '設定'
|
124
124
|
click_link '時差調整'
|
125
|
-
page.should have_field('hour_offset', :
|
125
|
+
page.should have_field('hour_offset', with: '-24.0')
|
126
126
|
end
|
127
127
|
|
128
128
|
scenario 'Rack 環境でテーマ選択が保存される', :exclude_selenium do
|
129
129
|
visit '/update.rb?conf=theme'
|
130
|
-
select 'Tdiary1', :
|
130
|
+
select 'Tdiary1', from: 'theme'
|
131
131
|
|
132
132
|
page.all('div.saveconf').first.click_button "OK"
|
133
133
|
|
@@ -143,7 +143,7 @@ FOOTER
|
|
143
143
|
|
144
144
|
scenario 'Webrick 環境でテーマ選択が保存される', :exclude_rack do
|
145
145
|
visit '/update.rb?conf=theme'
|
146
|
-
select 'Tdiary1', :
|
146
|
+
select 'Tdiary1', from: 'theme'
|
147
147
|
|
148
148
|
page.all('div.saveconf').first.click_button "OK"
|
149
149
|
|
@@ -5,9 +5,9 @@ require 'resolv'
|
|
5
5
|
feature 'spamフィルタ設定の利用', :exclude_selenium do
|
6
6
|
scenario 'IPベースのブラックリストの spam-champuru が spamlookup に置き換わる' do
|
7
7
|
visit '/update.rb?conf=dnsblfilter'
|
8
|
-
fill_in 'spamlookup.ip.list', :
|
9
|
-
fill_in 'spamlookup.domain.list', :
|
10
|
-
fill_in 'spamlookup.safe_domain.list', :
|
8
|
+
fill_in 'spamlookup.ip.list', with: "dnsbl.spam-champuru.livedoor.com"
|
9
|
+
fill_in 'spamlookup.domain.list', with: ""
|
10
|
+
fill_in 'spamlookup.safe_domain.list', with: ""
|
11
11
|
page.all('div.saveconf').first.click_button 'OK'
|
12
12
|
|
13
13
|
visit '/update.rb?conf=dnsblfilter'
|
@@ -22,15 +22,15 @@ feature 'spamフィルタ設定の利用', :exclude_selenium do
|
|
22
22
|
append_default_diary
|
23
23
|
|
24
24
|
visit '/update.rb?conf=dnsblfilter'
|
25
|
-
fill_in 'spamlookup.ip.list', :
|
26
|
-
fill_in 'spamlookup.domain.list', :
|
27
|
-
fill_in 'spamlookup.safe_domain.list', :
|
25
|
+
fill_in 'spamlookup.ip.list', with: "bsb.spamlookup.net"
|
26
|
+
fill_in 'spamlookup.domain.list', with: ""
|
27
|
+
fill_in 'spamlookup.safe_domain.list', with: ""
|
28
28
|
page.all('div.saveconf').first.click_button 'OK'
|
29
29
|
|
30
30
|
visit "/"
|
31
31
|
click_link 'ツッコミを入れる'
|
32
|
-
fill_in "name", :
|
33
|
-
fill_in "body", :
|
32
|
+
fill_in "name", with: "alpha"
|
33
|
+
fill_in "body", with: <<-BODY
|
34
34
|
こんにちは!こんにちは!
|
35
35
|
http://www.example.com
|
36
36
|
BODY
|
@@ -47,15 +47,15 @@ BODY
|
|
47
47
|
append_default_diary
|
48
48
|
|
49
49
|
visit '/update.rb?conf=dnsblfilter'
|
50
|
-
fill_in 'spamlookup.ip.list', :
|
51
|
-
fill_in 'spamlookup.domain.list', :
|
52
|
-
fill_in 'spamlookup.safe_domain.list', :
|
50
|
+
fill_in 'spamlookup.ip.list', with: "bsb.spamlookup.net"
|
51
|
+
fill_in 'spamlookup.domain.list', with: ""
|
52
|
+
fill_in 'spamlookup.safe_domain.list', with: ""
|
53
53
|
page.all('div.saveconf').first.click_button 'OK'
|
54
54
|
|
55
55
|
visit "/"
|
56
56
|
click_link 'ツッコミを入れる'
|
57
|
-
fill_in "name", :
|
58
|
-
fill_in "body", :
|
57
|
+
fill_in "name", with: "alpha"
|
58
|
+
fill_in "body", with: <<-BODY
|
59
59
|
こんにちは!こんにちは!
|
60
60
|
http://www.example.com
|
61
61
|
BODY
|
@@ -72,15 +72,15 @@ BODY
|
|
72
72
|
append_default_diary
|
73
73
|
|
74
74
|
visit '/update.rb?conf=dnsblfilter'
|
75
|
-
fill_in 'spamlookup.ip.list', :
|
76
|
-
fill_in 'spamlookup.domain.list', :
|
77
|
-
fill_in 'spamlookup.safe_domain.list', :
|
75
|
+
fill_in 'spamlookup.ip.list', with: ""
|
76
|
+
fill_in 'spamlookup.domain.list', with: "bsb.spamlookup.net"
|
77
|
+
fill_in 'spamlookup.safe_domain.list', with: ""
|
78
78
|
page.all('div.saveconf').first.click_button 'OK'
|
79
79
|
|
80
80
|
visit "/"
|
81
81
|
click_link 'ツッコミを入れる'
|
82
|
-
fill_in "name", :
|
83
|
-
fill_in "body", :
|
82
|
+
fill_in "name", with: "alpha"
|
83
|
+
fill_in "body", with: <<-BODY
|
84
84
|
こんにちは!こんにちは!
|
85
85
|
http://www.example.com
|
86
86
|
BODY
|
@@ -97,15 +97,15 @@ BODY
|
|
97
97
|
append_default_diary
|
98
98
|
|
99
99
|
visit '/update.rb?conf=dnsblfilter'
|
100
|
-
fill_in 'spamlookup.ip.list', :
|
101
|
-
fill_in 'spamlookup.domain.list', :
|
102
|
-
fill_in 'spamlookup.safe_domain.list', :
|
100
|
+
fill_in 'spamlookup.ip.list', with: ""
|
101
|
+
fill_in 'spamlookup.domain.list', with: "bsb.spamlookup.net"
|
102
|
+
fill_in 'spamlookup.safe_domain.list', with: ""
|
103
103
|
page.all('div.saveconf').first.click_button 'OK'
|
104
104
|
|
105
105
|
visit "/"
|
106
106
|
click_link 'ツッコミを入れる'
|
107
|
-
fill_in "name", :
|
108
|
-
fill_in "body", :
|
107
|
+
fill_in "name", with: "alpha"
|
108
|
+
fill_in "body", with: <<-BODY
|
109
109
|
こんにちは!こんにちは!
|
110
110
|
http://www.example.com
|
111
111
|
BODY
|
@@ -123,15 +123,15 @@ BODY
|
|
123
123
|
append_default_diary
|
124
124
|
|
125
125
|
visit '/update.rb?conf=dnsblfilter'
|
126
|
-
fill_in 'spamlookup.ip.list', :
|
127
|
-
fill_in 'spamlookup.domain.list', :
|
128
|
-
fill_in 'spamlookup.safe_domain.list', :
|
126
|
+
fill_in 'spamlookup.ip.list', with: "bsb.spamlookup.net"
|
127
|
+
fill_in 'spamlookup.domain.list', with: "bsb.spamlookup.net"
|
128
|
+
fill_in 'spamlookup.safe_domain.list', with: "www.example.com"
|
129
129
|
page.all('div.saveconf').first.click_button 'OK'
|
130
130
|
|
131
131
|
visit "/"
|
132
132
|
click_link 'ツッコミを入れる'
|
133
|
-
fill_in "name", :
|
134
|
-
fill_in "body", :
|
133
|
+
fill_in "name", with: "alpha"
|
134
|
+
fill_in "body", with: <<-BODY
|
135
135
|
こんにちは!こんにちは!
|
136
136
|
http://www.example.com
|
137
137
|
BODY
|
@@ -5,35 +5,35 @@ feature 'リンク元設定の利用' do
|
|
5
5
|
scenario 'リンク元の非表示設定' do
|
6
6
|
append_default_diary
|
7
7
|
visit '/update.rb?conf=referer'
|
8
|
-
select('非表示', :
|
8
|
+
select('非表示', from: 'show_referer')
|
9
9
|
|
10
10
|
page.all('div.saveconf').first.click_button "OK"
|
11
11
|
# within('title') { page.should have_content('(設定完了)') }
|
12
12
|
|
13
13
|
click_link '最新'
|
14
14
|
today = Date.today.strftime("%Y年%m月%d日")
|
15
|
-
page.find('h2', :
|
15
|
+
page.find('h2', text: today).click_link today
|
16
16
|
within('div.day') { page.should have_no_css('div[class="refererlist"]') }
|
17
17
|
end
|
18
18
|
|
19
19
|
scenario 'リンク元記録の除外設定が動いている' do
|
20
20
|
append_default_diary
|
21
21
|
visit '/update.rb?conf=referer'
|
22
|
-
fill_in 'no_referer', :
|
22
|
+
fill_in 'no_referer', with: '^http://www\.example\.com/.*'
|
23
23
|
|
24
24
|
page.all('div.saveconf').first.click_button('OK')
|
25
25
|
# within('title') { page.should have_content('(設定完了)') }
|
26
26
|
|
27
27
|
click_link '最新'
|
28
28
|
today = Date.today.strftime('%Y年%m月%d日')
|
29
|
-
page.find('h2', :
|
29
|
+
page.find('h2', text: today).click_link today
|
30
30
|
within('div.day div.refererlist') { page.should have_no_link('http://www.example.com') }
|
31
31
|
end
|
32
32
|
|
33
33
|
scenario 'リンク元の置換が動いている', :exclude_selenium do
|
34
34
|
append_default_diary
|
35
35
|
visit '/update.rb?conf=referer'
|
36
|
-
fill_in 'referer_table', :
|
36
|
+
fill_in 'referer_table', with: <<-REFERER
|
37
37
|
^http://www\.example\.com/.* alice
|
38
38
|
^http://www\.example\.net/.* bob
|
39
39
|
REFERER
|
@@ -43,7 +43,7 @@ REFERER
|
|
43
43
|
|
44
44
|
click_link '最新'
|
45
45
|
today = Date.today.strftime('%Y年%m月%d日')
|
46
|
-
page.find('h2', :
|
46
|
+
page.find('h2', text: today).click_link today
|
47
47
|
within('div.day div.refererlist') {
|
48
48
|
page.should have_link "alice"
|
49
49
|
page.should have_no_link "http://www.example.com"
|
@@ -30,14 +30,14 @@ feature 'spamフィルタ設定の利用' do
|
|
30
30
|
append_default_diary
|
31
31
|
|
32
32
|
visit '/update.rb?conf=spamfilter'
|
33
|
-
select '捨てる', :
|
34
|
-
fill_in "spamfilter.max_uris", :
|
33
|
+
select '捨てる', from: 'spamfilter.filter_mode'
|
34
|
+
fill_in "spamfilter.max_uris", with: 1
|
35
35
|
page.all('div.saveconf').first.click_button 'OK'
|
36
36
|
|
37
37
|
visit "/"
|
38
38
|
click_link 'ツッコミを入れる'
|
39
|
-
fill_in "name", :
|
40
|
-
fill_in "body", :
|
39
|
+
fill_in "name", with: "alpha"
|
40
|
+
fill_in "body", with: <<-BODY
|
41
41
|
こんにちは!こんにちは!
|
42
42
|
http://www.example.org
|
43
43
|
http://www.example.org
|
@@ -45,9 +45,9 @@ BODY
|
|
45
45
|
click_button '投稿'
|
46
46
|
|
47
47
|
visit '/update.rb'
|
48
|
-
fill_in "year", :
|
49
|
-
fill_in "month", :
|
50
|
-
fill_in "day", :
|
48
|
+
fill_in "year", with: Date.today.year
|
49
|
+
fill_in "month", with: Date.today.month
|
50
|
+
fill_in "day", with: Date.today.day
|
51
51
|
click_button 'この日付の日記を編集'
|
52
52
|
|
53
53
|
page.should have_no_content "alpha"
|
@@ -58,13 +58,13 @@ BODY
|
|
58
58
|
append_default_diary
|
59
59
|
|
60
60
|
visit '/update.rb?conf=spamfilter'
|
61
|
-
fill_in "spamfilter.max_uris", :
|
61
|
+
fill_in "spamfilter.max_uris", with: 1
|
62
62
|
page.all('div.saveconf').first.click_button 'OK'
|
63
63
|
|
64
64
|
visit "/"
|
65
65
|
click_link 'ツッコミを入れる'
|
66
|
-
fill_in "name", :
|
67
|
-
fill_in "body", :
|
66
|
+
fill_in "name", with: "alpha"
|
67
|
+
fill_in "body", with: <<-BODY
|
68
68
|
こんにちは!こんにちは!
|
69
69
|
http://www.example.org
|
70
70
|
http://www.example.org
|
@@ -73,8 +73,8 @@ BODY
|
|
73
73
|
|
74
74
|
visit "/"
|
75
75
|
click_link 'ツッコミを入れる'
|
76
|
-
fill_in "name", :
|
77
|
-
fill_in "body", :
|
76
|
+
fill_in "name", with: "bravo"
|
77
|
+
fill_in "body", with: <<-BODY
|
78
78
|
こんばんは!こんばんは!
|
79
79
|
http://www.example.org
|
80
80
|
BODY
|
@@ -91,7 +91,7 @@ BODY
|
|
91
91
|
append_default_diary
|
92
92
|
|
93
93
|
visit '/update.rb?conf=spamfilter'
|
94
|
-
fill_in "spamfilter.max_rate", :
|
94
|
+
fill_in "spamfilter.max_rate", with: 50
|
95
95
|
|
96
96
|
page.all('div.saveconf').first.click_button 'OK'
|
97
97
|
# capybara-2.0 can't find title element
|
@@ -99,8 +99,8 @@ BODY
|
|
99
99
|
|
100
100
|
visit "/"
|
101
101
|
click_link 'ツッコミを入れる'
|
102
|
-
fill_in "name", :
|
103
|
-
fill_in "body", :
|
102
|
+
fill_in "name", with: "alpha"
|
103
|
+
fill_in "body", with: <<-BODY
|
104
104
|
こんにちは!こんにちは!
|
105
105
|
http://www.example.org
|
106
106
|
http://www.example.org
|
@@ -110,8 +110,8 @@ BODY
|
|
110
110
|
|
111
111
|
visit "/"
|
112
112
|
click_link 'ツッコミを入れる'
|
113
|
-
fill_in "name", :
|
114
|
-
fill_in "body", :
|
113
|
+
fill_in "name", with: "bravo"
|
114
|
+
fill_in "body", with: <<-BODY
|
115
115
|
こんばんは!こんばんは!
|
116
116
|
こんばんは!こんばんは!
|
117
117
|
http://www.example.org
|
@@ -129,7 +129,7 @@ BODY
|
|
129
129
|
append_default_diary
|
130
130
|
|
131
131
|
visit '/update.rb?conf=spamfilter'
|
132
|
-
fill_in "spamfilter.bad_comment_patts", :
|
132
|
+
fill_in "spamfilter.bad_comment_patts", with: <<-BODY
|
133
133
|
こんにちは!
|
134
134
|
BODY
|
135
135
|
page.all('div.saveconf').first.click_button 'OK'
|
@@ -137,8 +137,8 @@ BODY
|
|
137
137
|
|
138
138
|
visit "/"
|
139
139
|
click_link 'ツッコミを入れる'
|
140
|
-
fill_in "name", :
|
141
|
-
fill_in "body", :
|
140
|
+
fill_in "name", with: "alpha"
|
141
|
+
fill_in "body", with: <<-BODY
|
142
142
|
こんにちは!こんにちは!
|
143
143
|
BODY
|
144
144
|
click_button '投稿'
|
@@ -152,25 +152,25 @@ BODY
|
|
152
152
|
append_default_diary
|
153
153
|
|
154
154
|
visit '/update.rb?conf=spamfilter'
|
155
|
-
fill_in "spamfilter.bad_mail_patts", :
|
155
|
+
fill_in "spamfilter.bad_mail_patts", with: <<-BODY
|
156
156
|
example.com
|
157
157
|
BODY
|
158
158
|
page.all('div.saveconf').first.click_button 'OK'
|
159
159
|
|
160
160
|
visit "/"
|
161
161
|
click_link 'ツッコミを入れる'
|
162
|
-
fill_in "name", :
|
163
|
-
fill_in "mail", :
|
164
|
-
fill_in "body", :
|
162
|
+
fill_in "name", with: "alpha"
|
163
|
+
fill_in "mail", with: "admin@example.com"
|
164
|
+
fill_in "body", with: <<-BODY
|
165
165
|
こんにちは!こんにちは!
|
166
166
|
BODY
|
167
167
|
click_button '投稿'
|
168
168
|
|
169
169
|
visit "/"
|
170
170
|
click_link 'ツッコミを入れる'
|
171
|
-
fill_in "name", :
|
172
|
-
fill_in "mail", :
|
173
|
-
fill_in "body", :
|
171
|
+
fill_in "name", with: "bravo"
|
172
|
+
fill_in "mail", with: "t@tdtds.jp"
|
173
|
+
fill_in "body", with: <<-BODY
|
174
174
|
こんばんは!こんばんは!
|
175
175
|
BODY
|
176
176
|
click_button '投稿'
|
@@ -187,23 +187,23 @@ BODY
|
|
187
187
|
append_default_diary
|
188
188
|
|
189
189
|
visit '/update.rb?conf=spamfilter'
|
190
|
-
fill_in "spamfilter.bad_uri_patts", :
|
190
|
+
fill_in "spamfilter.bad_uri_patts", with: <<-BODY
|
191
191
|
example
|
192
192
|
BODY
|
193
193
|
page.all('div.saveconf').first.click_button 'OK'
|
194
194
|
|
195
195
|
visit "/"
|
196
196
|
click_link 'ツッコミを入れる'
|
197
|
-
fill_in "name", :
|
198
|
-
fill_in "body", :
|
197
|
+
fill_in "name", with: "alpha"
|
198
|
+
fill_in "body", with: <<-BODY
|
199
199
|
こんにちは! http://www.example.com
|
200
200
|
BODY
|
201
201
|
click_button '投稿'
|
202
202
|
|
203
203
|
visit "/"
|
204
204
|
click_link 'ツッコミを入れる'
|
205
|
-
fill_in "name", :
|
206
|
-
fill_in "body", :
|
205
|
+
fill_in "name", with: "bravo"
|
206
|
+
fill_in "body", with: <<-BODY
|
207
207
|
example こんにちは!
|
208
208
|
BODY
|
209
209
|
click_button '投稿'
|
@@ -219,15 +219,15 @@ BODY
|
|
219
219
|
append_default_diary
|
220
220
|
|
221
221
|
visit '/update.rb?conf=spamfilter'
|
222
|
-
fill_in "spamfilter.bad_ip_addrs", :
|
222
|
+
fill_in "spamfilter.bad_ip_addrs", with: <<-BODY
|
223
223
|
127.0.0.1
|
224
224
|
BODY
|
225
225
|
page.all('div.saveconf').first.click_button 'OK'
|
226
226
|
|
227
227
|
visit "/"
|
228
228
|
click_link 'ツッコミを入れる'
|
229
|
-
fill_in "name", :
|
230
|
-
fill_in "body", :
|
229
|
+
fill_in "name", with: "alpha"
|
230
|
+
fill_in "body", with: <<-BODY
|
231
231
|
こんにちは!こんにちは!
|
232
232
|
BODY
|
233
233
|
click_button '投稿'
|
@@ -241,7 +241,7 @@ BODY
|
|
241
241
|
append_default_diary
|
242
242
|
|
243
243
|
visit '/update.rb?conf=spamfilter'
|
244
|
-
fill_in 'comment_description', :
|
244
|
+
fill_in 'comment_description', with: 'これはツッコミの注意文です'
|
245
245
|
page.all('div.saveconf').first.click_button 'OK'
|
246
246
|
|
247
247
|
visit "/"
|
@@ -261,7 +261,7 @@ BODY
|
|
261
261
|
|
262
262
|
visit '/update.rb?conf=spamfilter'
|
263
263
|
page.should have_field 'filter.debug_mode'
|
264
|
-
select '記録しない', :
|
264
|
+
select '記録しない', from: 'filter.debug_mode'
|
265
265
|
page.all('div.saveconf').first.click_button 'OK'
|
266
266
|
|
267
267
|
visit '/update.rb?conf=spamfilter'
|
@@ -4,11 +4,11 @@ module HelperMethods
|
|
4
4
|
def append_default_diary(ymd = Date.today.to_s)
|
5
5
|
date = Date.parse(ymd)
|
6
6
|
visit '/update.rb'
|
7
|
-
fill_in "year", :
|
8
|
-
fill_in "month", :
|
9
|
-
fill_in "day", :
|
10
|
-
fill_in "title", :
|
11
|
-
fill_in "body", :
|
7
|
+
fill_in "year", with: date.year
|
8
|
+
fill_in "month", with: date.month
|
9
|
+
fill_in "day", with: date.day
|
10
|
+
fill_in "title", with: "tDiaryのテスト"
|
11
|
+
fill_in "body", with: <<-BODY
|
12
12
|
!さて、テストである。
|
13
13
|
とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P
|
14
14
|
BODY
|
@@ -18,10 +18,10 @@ BODY
|
|
18
18
|
def append_default_comment(ymd = Date.today.to_s)
|
19
19
|
visit "/"
|
20
20
|
date = Date.parse(ymd).strftime('%Y年%m月%d日')
|
21
|
-
page.find('h2', :
|
21
|
+
page.find('h2', text: date).click_link date
|
22
22
|
click_link 'ツッコミを入れる'
|
23
|
-
fill_in "name", :
|
24
|
-
fill_in "body", :
|
23
|
+
fill_in "name", with: "alpha"
|
24
|
+
fill_in "body", with: 'こんにちは!こんにちは!'
|
25
25
|
click_button '投稿'
|
26
26
|
end
|
27
27
|
|