tdiary 4.0.2.20140201 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -0
  3. data/ChangeLog +3 -0
  4. data/Gemfile +5 -5
  5. data/Gemfile.lock +48 -29
  6. data/README.md +1 -1
  7. data/Rakefile +1 -1
  8. data/index.rb +2 -2
  9. data/js/01conf.js +16 -0
  10. data/misc/convert2.rb +3 -3
  11. data/misc/filter/limitdays.rb +2 -2
  12. data/misc/filter/linkcheck.rb +2 -2
  13. data/misc/lib/fcgi_patch.rb +3 -3
  14. data/misc/paas/cloudfoundry/Gemfile.lock +51 -48
  15. data/misc/paas/heroku/Gemfile.lock +23 -21
  16. data/misc/paas/sqale/Gemfile.lock +23 -21
  17. data/misc/plugin/a.rb +4 -4
  18. data/misc/plugin/calendar2.rb +1 -1
  19. data/misc/plugin/category.rb +3 -3
  20. data/misc/plugin/comment_emoji_autocomplete.rb +1 -1
  21. data/misc/plugin/comment_mail-qmail.rb +1 -1
  22. data/misc/plugin/comment_mail-sendmail.rb +1 -1
  23. data/misc/plugin/comment_mail-smtp.rb +1 -1
  24. data/misc/plugin/counter.rb +27 -27
  25. data/misc/plugin/disp_referrer.rb +1 -1
  26. data/misc/plugin/en/amazon.rb +2 -2
  27. data/misc/plugin/en/category.rb +1 -1
  28. data/misc/plugin/en/counter.rb +1 -1
  29. data/misc/plugin/en/disp_referrer.rb +1 -1
  30. data/misc/plugin/en/kw.rb +1 -1
  31. data/misc/plugin/en/search_form.rb +1 -1
  32. data/misc/plugin/en/todo.rb +1 -1
  33. data/misc/plugin/en/weather.rb +5 -2
  34. data/misc/plugin/image.rb +2 -2
  35. data/misc/plugin/ja/disp_referrer.rb +7 -7
  36. data/misc/plugin/ja/my-sequel.rb +1 -1
  37. data/misc/plugin/ja/recent_comment3.rb +1 -1
  38. data/misc/plugin/ja/referer_scheme.rb +1 -1
  39. data/misc/plugin/ja/search_control.rb +1 -1
  40. data/misc/plugin/ja/search_form.rb +2 -2
  41. data/misc/plugin/ja/todo.rb +1 -1
  42. data/misc/plugin/ja/weather.rb +17 -12
  43. data/misc/plugin/makelirs.rb +4 -4
  44. data/misc/plugin/my-ex.rb +1 -1
  45. data/misc/plugin/my-sequel.rb +1 -1
  46. data/misc/plugin/pb-show.rb +1 -1
  47. data/misc/plugin/recent_comment.rb +5 -5
  48. data/misc/plugin/recent_comment3.rb +2 -2
  49. data/misc/plugin/recent_namazu.rb +4 -4
  50. data/misc/plugin/recent_rss.rb +7 -7
  51. data/misc/plugin/referer_scheme.rb +2 -2
  52. data/misc/plugin/search-default.rb +1 -1
  53. data/misc/plugin/sn.rb +3 -3
  54. data/misc/plugin/speed_comment.rb +1 -1
  55. data/misc/plugin/squeeze.rb +8 -8
  56. data/misc/plugin/tb-show.rb +1 -1
  57. data/misc/plugin/theme_online.rb +25 -0
  58. data/misc/plugin/tlink.rb +2 -2
  59. data/misc/plugin/todo.rb +2 -2
  60. data/misc/plugin/weather.rb +82 -26
  61. data/misc/plugin/whatsnew.rb +1 -1
  62. data/misc/plugin/xmlrpc/xmlrpc.rb +11 -11
  63. data/misc/theme_convert/theme_convert.rb +3 -3
  64. data/plugin/00default.rb +35 -28
  65. data/plugin/50sp.rb +1 -1
  66. data/plugin/60sf.rb +1 -1
  67. data/plugin/90migrate.rb +2 -2
  68. data/plugin/en/00default.rb +1 -1
  69. data/plugin/ja/00default.rb +1 -1
  70. data/spec/acceptance/append_comment_spec.rb +18 -18
  71. data/spec/acceptance/append_diary_spec.rb +22 -22
  72. data/spec/acceptance/bugfix/encoding_error_spec.rb +1 -1
  73. data/spec/acceptance/save_conf_comment_spec.rb +15 -15
  74. data/spec/acceptance/save_conf_default_spec.rb +26 -26
  75. data/spec/acceptance/save_conf_dnsbl_spec.rb +19 -19
  76. data/spec/acceptance/save_conf_filter_spec.rb +6 -6
  77. data/spec/acceptance/save_conf_plugin_spec.rb +11 -11
  78. data/spec/acceptance/save_conf_referer_spec.rb +4 -4
  79. data/spec/acceptance/save_conf_security_spec.rb +28 -28
  80. data/spec/acceptance/update_diary_spec.rb +16 -16
  81. data/spec/acceptance/view_category_spec.rb +1 -1
  82. data/spec/acceptance/view_comment_spec.rb +6 -6
  83. data/spec/acceptance/view_diary_spec.rb +25 -25
  84. data/spec/acceptance/view_referer_spec.rb +3 -3
  85. data/spec/core/compatible_spec.rb +5 -5
  86. data/spec/core/configuration_spec.rb +3 -3
  87. data/spec/core/core_ext_spec.rb +7 -7
  88. data/spec/core/io/default_spec.rb +1 -1
  89. data/spec/core/plugin_spec.rb +41 -41
  90. data/spec/core/rack/assets/precompile_spec.rb +3 -3
  91. data/spec/core/rack/html_anchor_spec.rb +15 -15
  92. data/spec/core/rack/static_spec.rb +3 -3
  93. data/spec/core/rack/valid_request_path_spec.rb +13 -13
  94. data/spec/core/style/tdiary_style_spec.rb +10 -10
  95. data/spec/core/style/wiki_style_spec.rb +16 -16
  96. data/spec/plugin/bq_spec.rb +2 -2
  97. data/spec/spec_helper.rb +3 -1
  98. data/tdiary/configuration.rb +2 -2
  99. data/tdiary/environment.rb +1 -1
  100. data/tdiary/io/default.rb +1 -1
  101. data/tdiary/lang/ja.rb +2 -2
  102. data/tdiary/tasks/db.rake +5 -5
  103. data/tdiary/version.rb +1 -1
  104. data/test/disp_referrer_test.rb +4 -4
  105. data/test/my-sequel_test.rb +1 -1
  106. data/test/test_plugin_helper.rb +47 -0
  107. data/test/weather-ADDS-METARS-PHTO-140131.html +109 -0
  108. data/test/weather-ADDS-METARS-RJAA-130131.html +111 -0
  109. data/test/weather-ADDS-METARS-RJAA-130227.html +111 -0
  110. data/test/weather_test.rb +144 -18
  111. data/update.rb +2 -2
  112. metadata +10 -3
@@ -6,13 +6,13 @@ feature 'spamフィルタ設定の利用' do
6
6
  visit '/update.rb?conf=sf'
7
7
 
8
8
  page.all('div.saveconf').first.click_button 'OK'
9
- page.should_not have_content '新入荷'
9
+ expect(page).not_to have_content '新入荷'
10
10
 
11
11
  FileUtils.cp_r "#{TDiary::PATH}/spec/fixtures/sample.rb", "#{TDiary::PATH}/misc/filter/"
12
12
 
13
13
  click_link 'スパムフィルター選択'
14
- page.should have_content '新入荷'
15
- page.should have_content 'sample.rb'
14
+ expect(page).to have_content '新入荷'
15
+ expect(page).to have_content 'sample.rb'
16
16
 
17
17
  FileUtils.rm "#{TDiary::PATH}/misc/filter/sample.rb"
18
18
  end
@@ -24,7 +24,7 @@ feature 'spamフィルタ設定の利用' do
24
24
  check "sf.sample.rb"
25
25
  page.all('div.saveconf').first.click_button 'OK'
26
26
 
27
- page.should have_checked_field "sf.sample.rb"
27
+ expect(page).to have_checked_field "sf.sample.rb"
28
28
 
29
29
  FileUtils.rm "#{TDiary::PATH}/misc/filter/sample.rb"
30
30
  end
@@ -33,11 +33,11 @@ feature 'spamフィルタ設定の利用' do
33
33
  FileUtils.cp_r "#{TDiary::PATH}/spec/fixtures/sample.rb", "#{TDiary::PATH}/misc/filter/"
34
34
 
35
35
  visit '/update.rb?conf=sf'
36
- page.should have_content 'sample.rb'
36
+ expect(page).to have_content 'sample.rb'
37
37
 
38
38
  FileUtils.rm "#{TDiary::PATH}/misc/filter/sample.rb"
39
39
  click_link 'スパムフィルター選択'
40
- page.should_not have_content 'sample.rb'
40
+ expect(page).not_to have_content 'sample.rb'
41
41
  end
42
42
  end
43
43
 
@@ -5,18 +5,18 @@ feature 'プラグイン選択設定の利用' do
5
5
  plugin_path = "#{TDiary::PATH}/misc/plugin/rspec.rb"
6
6
 
7
7
  scenario '新入荷のプラグインが表示される' do
8
- FileUtils.rm plugin_path if File.exists? plugin_path
8
+ FileUtils.rm plugin_path if File.exist? plugin_path
9
9
 
10
10
  visit '/update.rb?conf=sp'
11
11
  page.all('div.saveconf').first.click_button 'OK'
12
- page.should_not have_content '新入荷'
12
+ expect(page).not_to have_content '新入荷'
13
13
 
14
14
  FileUtils.touch plugin_path
15
15
 
16
16
  click_link 'プラグイン選択'
17
17
 
18
- page.should have_content '新入荷'
19
- page.should have_content 'rspec.rb'
18
+ expect(page).to have_content '新入荷'
19
+ expect(page).to have_content 'rspec.rb'
20
20
 
21
21
  FileUtils.rm plugin_path
22
22
  end
@@ -29,7 +29,7 @@ feature 'プラグイン選択設定の利用' do
29
29
  check "sp.rspec.rb"
30
30
  page.all('div.saveconf').first.click_button 'OK'
31
31
 
32
- page.should have_checked_field "sp.rspec.rb"
32
+ expect(page).to have_checked_field "sp.rspec.rb"
33
33
 
34
34
  FileUtils.rm plugin_path
35
35
  end
@@ -38,12 +38,12 @@ feature 'プラグイン選択設定の利用' do
38
38
  FileUtils.touch plugin_path
39
39
 
40
40
  visit '/update.rb?conf=sp'
41
- page.should have_content 'rspec.rb'
41
+ expect(page).to have_content 'rspec.rb'
42
42
 
43
43
  FileUtils.rm plugin_path
44
44
 
45
45
  click_link 'プラグイン選択'
46
- page.should_not have_content 'rspec.rb'
46
+ expect(page).not_to have_content 'rspec.rb'
47
47
  end
48
48
 
49
49
  scenario '外部の Javascript を追加するプラグインを有効にする' do
@@ -54,10 +54,10 @@ feature 'プラグイン選択設定の利用' do
54
54
 
55
55
  visit '/update.rb'
56
56
 
57
- page.body.should be_include('caretposition.js')
58
- page.body.should be_include('category_autocomplete.js')
59
- page.body.should be_include('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js')
60
- page.body.should_not be_include('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js?')
57
+ expect(page.body).to be_include('caretposition.js')
58
+ expect(page.body).to be_include('category_autocomplete.js')
59
+ expect(page.body).to be_include('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js')
60
+ expect(page.body).not_to be_include('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js?')
61
61
  end
62
62
  end
63
63
  # Local Variables:
@@ -13,7 +13,7 @@ feature 'リンク元設定の利用' do
13
13
  click_link '最新'
14
14
  today = Date.today.strftime("%Y年%m月%d日")
15
15
  page.find('h2', text: today).click_link today
16
- within('div.day') { page.should have_no_css('div[class="refererlist"]') }
16
+ within('div.day') { expect(page).to have_no_css('div[class="refererlist"]') }
17
17
  end
18
18
 
19
19
  scenario 'リンク元記録の除外設定が動いている' do
@@ -27,7 +27,7 @@ feature 'リンク元設定の利用' do
27
27
  click_link '最新'
28
28
  today = Date.today.strftime('%Y年%m月%d日')
29
29
  page.find('h2', text: today).click_link today
30
- within('div.day div.refererlist') { page.should have_no_link('http://www.example.com') }
30
+ within('div.day div.refererlist') { expect(page).to have_no_link('http://www.example.com') }
31
31
  end
32
32
 
33
33
  scenario 'リンク元の置換が動いている', :exclude_selenium do
@@ -45,8 +45,8 @@ REFERER
45
45
  today = Date.today.strftime('%Y年%m月%d日')
46
46
  page.find('h2', text: today).click_link today
47
47
  within('div.day div.refererlist') {
48
- page.should have_link "alice"
49
- page.should have_no_link "http://www.example.com"
48
+ expect(page).to have_link "alice"
49
+ expect(page).to have_no_link "http://www.example.com"
50
50
  }
51
51
  end
52
52
  end
@@ -11,7 +11,7 @@ feature 'spamフィルタ設定の利用' do
11
11
  page.all('div.saveconf').first.click_button 'OK'
12
12
 
13
13
  visit '/update.rb?conf=sp'
14
- page.should have_checked_field 'sp.hide-mail-field.rb'
14
+ expect(page).to have_checked_field 'sp.hide-mail-field.rb'
15
15
  end
16
16
 
17
17
  scenario 'CSRF対策の設定が保存される' do
@@ -23,7 +23,7 @@ feature 'spamフィルタ設定の利用' do
23
23
  page.all('div.saveconf').first.click_button 'OK'
24
24
 
25
25
  visit '/update.rb?conf=csrf_protection'
26
- page.should have_selector 'input[name="check_key"][value="true"][checked]'
26
+ expect(page).to have_selector 'input[name="check_key"][value="true"][checked]'
27
27
  end
28
28
 
29
29
  scenario 'spamと判定されたツッコミを捨てる' do
@@ -50,8 +50,8 @@ BODY
50
50
  fill_in "day", with: Date.today.day
51
51
  click_button 'この日付の日記を編集'
52
52
 
53
- page.should have_no_content "alpha"
54
- page.should have_no_content "こんにちは!こんにちは!"
53
+ expect(page).to have_no_content "alpha"
54
+ expect(page).to have_no_content "こんにちは!こんにちは!"
55
55
  end
56
56
 
57
57
  scenario 'URLの数によるspam判定' do
@@ -81,10 +81,10 @@ BODY
81
81
  click_button '投稿'
82
82
 
83
83
  visit "/"
84
- page.should have_no_content "alpha"
85
- page.should have_no_content "こんにちは!こんにちは!"
86
- page.should have_content "bravo"
87
- page.should have_content "こんばんは!こんばんは!"
84
+ expect(page).to have_no_content "alpha"
85
+ expect(page).to have_no_content "こんにちは!こんにちは!"
86
+ expect(page).to have_content "bravo"
87
+ expect(page).to have_content "こんばんは!こんばんは!"
88
88
  end
89
89
 
90
90
  scenario 'URLの割合によるspam判定' do
@@ -119,10 +119,10 @@ BODY
119
119
  click_button '投稿'
120
120
 
121
121
  visit "/"
122
- page.should have_no_content "alpha"
123
- page.should have_no_content "こんにちは!こんにちは!"
124
- page.should have_content "bravo"
125
- page.should have_content "こんばんは!こんばんは!"
122
+ expect(page).to have_no_content "alpha"
123
+ expect(page).to have_no_content "こんにちは!こんにちは!"
124
+ expect(page).to have_content "bravo"
125
+ expect(page).to have_content "こんばんは!こんばんは!"
126
126
  end
127
127
 
128
128
  scenario 'キーワードでツッコミがはじかれる' do
@@ -144,8 +144,8 @@ BODY
144
144
  click_button '投稿'
145
145
 
146
146
  visit "/"
147
- page.should have_no_content "alpha"
148
- page.should have_no_content "こんにちは!こんにちは!"
147
+ expect(page).to have_no_content "alpha"
148
+ expect(page).to have_no_content "こんにちは!こんにちは!"
149
149
  end
150
150
 
151
151
  scenario 'メールアドレスでツッコミがはじかれる' do
@@ -176,10 +176,10 @@ BODY
176
176
  click_button '投稿'
177
177
 
178
178
  visit "/"
179
- page.should have_no_content "alpha"
180
- page.should have_no_content "こんにちは!こんにちは!"
181
- page.should have_content "bravo"
182
- page.should have_content "こんばんは!こんばんは!"
179
+ expect(page).to have_no_content "alpha"
180
+ expect(page).to have_no_content "こんにちは!こんにちは!"
181
+ expect(page).to have_content "bravo"
182
+ expect(page).to have_content "こんばんは!こんばんは!"
183
183
 
184
184
  end
185
185
 
@@ -209,10 +209,10 @@ BODY
209
209
  click_button '投稿'
210
210
 
211
211
  visit "/"
212
- page.should have_no_content "alpha"
213
- page.should have_no_content "こんにちは! http://www.example.com"
214
- page.should have_content "bravo"
215
- page.should have_content "example こんにちは!"
212
+ expect(page).to have_no_content "alpha"
213
+ expect(page).to have_no_content "こんにちは! http://www.example.com"
214
+ expect(page).to have_content "bravo"
215
+ expect(page).to have_content "example こんにちは!"
216
216
  end
217
217
 
218
218
  scenario 'IPアドレスでツッコミが弾かれる' do
@@ -233,8 +233,8 @@ BODY
233
233
  click_button '投稿'
234
234
 
235
235
  visit "/"
236
- page.should have_no_content "alpha"
237
- page.should have_no_content "こんにちは!こんにちは!"
236
+ expect(page).to have_no_content "alpha"
237
+ expect(page).to have_no_content "こんにちは!こんにちは!"
238
238
  end
239
239
 
240
240
  scenario 'ツッコミの注意文が保存されて表示される' do
@@ -246,27 +246,27 @@ BODY
246
246
 
247
247
  visit "/"
248
248
  click_link 'ツッコミを入れる'
249
- page.should have_content 'これはツッコミの注意文です'
249
+ expect(page).to have_content 'これはツッコミの注意文です'
250
250
  end
251
251
 
252
252
  scenario 'スパムフィルターのログ記録の設定ができない', :exclude_no_secure do
253
253
  append_default_diary
254
254
 
255
255
  visit '/update.rb?conf=spamfilter'
256
- page.should_not have_field 'filter.debug_mode'
256
+ expect(page).not_to have_field 'filter.debug_mode'
257
257
  end
258
258
 
259
259
  scenario 'スパムフィルターのログ記録の設定が保存される', :exclude_secure do
260
260
  append_default_diary
261
261
 
262
262
  visit '/update.rb?conf=spamfilter'
263
- page.should have_field 'filter.debug_mode'
263
+ expect(page).to have_field 'filter.debug_mode'
264
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'
268
268
  within('select[name="filter.debug_mode"] option[selected]'){
269
- page.should have_content '記録しない'
269
+ expect(page).to have_content '記録しない'
270
270
  }
271
271
  end
272
272
  end
@@ -20,13 +20,13 @@ BODY
20
20
 
21
21
  visit '/'
22
22
  page.find('h2', text: '2001年04月23日').click_link '2001年04月23日'
23
- within('div.day span.title'){ page.should have_content "tDiaryのテスト" }
23
+ within('div.day span.title'){ expect(page).to have_content "tDiaryのテスト" }
24
24
  within('div.body'){
25
- page.should have_content "さて、テストである。"
26
- page.should have_content "もう一度テストである。"
25
+ expect(page).to have_content "さて、テストである。"
26
+ expect(page).to have_content "もう一度テストである。"
27
27
 
28
- page.should have_content "とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P"
29
- page.should have_content "本当に動くかな?"
28
+ expect(page).to have_content "とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P"
29
+ expect(page).to have_content "本当に動くかな?"
30
30
  }
31
31
 
32
32
  visit '/update.rb'
@@ -44,13 +44,13 @@ BODY
44
44
 
45
45
  visit '/'
46
46
  page.find('h2', text: '2001年04月23日').click_link '2001年04月23日'
47
- within('div.day span.title'){ page.should have_content "tDiaryのテスト" }
47
+ within('div.day span.title'){ expect(page).to have_content "tDiaryのテスト" }
48
48
  within('div.body'){
49
- page.should have_no_content "さて、テストである。"
50
- page.should have_content "もう一度テストである。"
49
+ expect(page).to have_no_content "さて、テストである。"
50
+ expect(page).to have_content "もう一度テストである。"
51
51
 
52
- page.should have_no_content "とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P"
53
- page.should have_content "本当に動くかな?"
52
+ expect(page).to have_no_content "とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P"
53
+ expect(page).to have_content "本当に動くかな?"
54
54
  }
55
55
  end
56
56
 
@@ -66,10 +66,10 @@ BODY
66
66
  within('div.textarea') { fill_in "body", with: '' }
67
67
 
68
68
  click_button "登録"
69
- page.should have_content "Click here!"
69
+ expect(page).to have_content "Click here!"
70
70
 
71
71
  visit '/'
72
- within('div.day') { page.should have_no_css('h3') }
72
+ within('div.day') { expect(page).to have_no_css('h3') }
73
73
  end
74
74
 
75
75
  scenario '日記を隠す' do
@@ -83,10 +83,10 @@ BODY
83
83
  check 'hide'
84
84
 
85
85
  click_button "登録"
86
- page.should have_content "Click here!"
86
+ expect(page).to have_content "Click here!"
87
87
 
88
88
  visit '/'
89
- page.should have_no_css('div[class="day"]')
89
+ expect(page).to have_no_css('div[class="day"]')
90
90
  end
91
91
 
92
92
  scenario '編集画面に前の日記と次の日記のリンク表示される' do
@@ -100,8 +100,8 @@ BODY
100
100
  fill_in "day", with: '3'
101
101
  click_button 'この日付の日記を編集'
102
102
 
103
- page.should have_content('«前の日記(2001年05月02日)')
104
- page.should have_content('次の日記(2001年05月04日)»')
103
+ expect(page).to have_content('«前の日記(2001年05月02日)')
104
+ expect(page).to have_content('次の日記(2001年05月04日)»')
105
105
  end
106
106
  end
107
107
 
@@ -25,7 +25,7 @@ BODY
25
25
 
26
26
  visit '/'
27
27
  page.find('a', text: "category").click
28
- page.should have_content 'Categories'
28
+ expect(page).to have_content 'Categories'
29
29
  end
30
30
  end
31
31
 
@@ -12,13 +12,13 @@ feature 'ツッコミの表示' do
12
12
  uncheck 'commentcheckboxr0'
13
13
  click_button 'ツッコミ表示状態変更'
14
14
  visit '/'
15
- page.should have_no_content "alpha"
16
- page.should have_no_content "こんにちは!こんにちは!"
15
+ expect(page).to have_no_content "alpha"
16
+ expect(page).to have_no_content "こんにちは!こんにちは!"
17
17
 
18
18
  today = Date.today.strftime("%Y年%m月%d日")
19
19
  page.find('h2', text: today).click_link today
20
- page.should have_no_content "alpha"
21
- page.should have_no_content "こんにちは!こんにちは!"
20
+ expect(page).to have_no_content "alpha"
21
+ expect(page).to have_no_content "こんにちは!こんにちは!"
22
22
  end
23
23
 
24
24
  scenario "日付表示だと絵文字を表示できる", :exclude_selenium do
@@ -36,7 +36,7 @@ BODY
36
36
  today = Date.today.strftime("%Y年%m月%d日")
37
37
  page.find('h2', text: today).click_link today
38
38
  within('div.day div.comment div.commentbody') {
39
- page.body.should be_include "<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/sushi.png' width='20' height='20' title='sushi' alt='sushi' class='emoji' /> は美味しい"
39
+ expect(page.body).to be_include "<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/sushi.png' width='20' height='20' title='sushi' alt='sushi' class='emoji' /> は美味しい"
40
40
  }
41
41
  end
42
42
 
@@ -53,7 +53,7 @@ BODY
53
53
 
54
54
  visit "/"
55
55
  within('div.day div.comment div.commentshort') {
56
- page.body.should be_include "<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/sushi.png' width='20' height='20' title='sushi' alt='sushi' class='emoji' /> は美味しい"
56
+ expect(page.body).to be_include "<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/sushi.png' width='20' height='20' title='sushi' alt='sushi' class='emoji' /> は美味しい"
57
57
  }
58
58
  end
59
59
  end
@@ -6,9 +6,9 @@ feature '日記を読む' do
6
6
  visit '/'
7
7
  # capybara-2.0 can't find header content.
8
8
  # within('title') { page.should have_content('【日記のタイトル】') }
9
- within('h1') { page.should have_content('【日記のタイトル】') }
10
- page.should have_css('a[href="update.rb"]')
11
- page.should have_css('a[href="update.rb?conf=default"]')
9
+ within('h1') { expect(page).to have_content('【日記のタイトル】') }
10
+ expect(page).to have_css('a[href="update.rb"]')
11
+ expect(page).to have_css('a[href="update.rb?conf=default"]')
12
12
  end
13
13
 
14
14
  scenario '月またぎの日記の表示' do
@@ -20,14 +20,14 @@ feature '日記を読む' do
20
20
 
21
21
  visit '/'
22
22
  page.find('h2', text: before_day).click_link "#{before_day}"
23
- within('div.adminmenu'){ page.should have_content "次の日記(#{after_day})"}
23
+ within('div.adminmenu'){ expect(page).to have_content "次の日記(#{after_day})"}
24
24
 
25
25
  click_link "次の日記(#{after_day})"
26
- within('div.day') { page.should have_content "#{after_day}" }
27
- within('div.adminmenu'){ page.should have_content "前の日記(#{before_day})"}
26
+ within('div.day') { expect(page).to have_content "#{after_day}" }
27
+ within('div.adminmenu'){ expect(page).to have_content "前の日記(#{before_day})"}
28
28
 
29
29
  click_link "前の日記(#{before_day})"
30
- within('div.day') { page.should have_content "#{before_day}" }
30
+ within('div.day') { expect(page).to have_content "#{before_day}" }
31
31
  end
32
32
 
33
33
  scenario 'n日前の日記をまとめて表示' do
@@ -35,16 +35,16 @@ feature '日記を読む' do
35
35
 
36
36
  visit '/'
37
37
  within('div.main') {
38
- page.should have_content "#{Date.parse('20100502').strftime('%Y年%m月%d日')}"
39
- page.should have_content "#{Date.parse('20100511').strftime('%Y年%m月%d日')}"
40
- page.should have_no_content "#{Date.parse('20100501').strftime('%Y年%m月%d日')}"
38
+ expect(page).to have_content "#{Date.parse('20100502').strftime('%Y年%m月%d日')}"
39
+ expect(page).to have_content "#{Date.parse('20100511').strftime('%Y年%m月%d日')}"
40
+ expect(page).to have_no_content "#{Date.parse('20100501').strftime('%Y年%m月%d日')}"
41
41
  }
42
42
 
43
43
  click_link "前10日分"
44
44
  within('div.main') {
45
- page.should have_no_content "#{Date.parse('20100502').strftime('%Y年%m月%d日')}"
46
- page.should have_no_content "#{Date.parse('20100511').strftime('%Y年%m月%d日')}"
47
- page.should have_content "#{Date.parse('20100501').strftime('%Y年%m月%d日')}"
45
+ expect(page).to have_no_content "#{Date.parse('20100502').strftime('%Y年%m月%d日')}"
46
+ expect(page).to have_no_content "#{Date.parse('20100511').strftime('%Y年%m月%d日')}"
47
+ expect(page).to have_content "#{Date.parse('20100501').strftime('%Y年%m月%d日')}"
48
48
  }
49
49
  end
50
50
 
@@ -58,19 +58,19 @@ feature '日記を読む' do
58
58
  click_link '長年日記'
59
59
 
60
60
  titles = page.all('h2 span.date a').map{|t| t.text }
61
- titles.should include '2001年04月23日'
62
- titles.should include '2002年04月23日'
63
- titles.should include '2003年04月23日'
61
+ expect(titles).to include '2001年04月23日'
62
+ expect(titles).to include '2002年04月23日'
63
+ expect(titles).to include '2003年04月23日'
64
64
  end
65
65
 
66
66
  scenario '指定をした日を表示' do
67
67
  append_default_diary('2001-04-23')
68
68
 
69
69
  visit '/?date=20010423'
70
- within('div.day span.title'){ page.should have_content "tDiaryのテスト" }
70
+ within('div.day span.title'){ expect(page).to have_content "tDiaryのテスト" }
71
71
  within('div.day div.section'){
72
- within('h3') { page.should have_content "さて、テストである。" }
73
- page.should have_content "とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P"
72
+ within('h3') { expect(page).to have_content "さて、テストである。" }
73
+ expect(page).to have_content "とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P"
74
74
  }
75
75
  end
76
76
 
@@ -107,12 +107,12 @@ BODY
107
107
 
108
108
  visit '/?date=200101'
109
109
  within('div.main'){
110
- page.should have_content "さて、テストである。"
111
- page.should have_content "さて、月末である。"
112
- page.should have_no_content "さて、月始めである。"
113
- page.should have_content "とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P"
114
- page.should have_content "今月も終わる"
115
- page.should have_no_content "今月も始まる"
110
+ expect(page).to have_content "さて、テストである。"
111
+ expect(page).to have_content "さて、月末である。"
112
+ expect(page).to have_no_content "さて、月始めである。"
113
+ expect(page).to have_content "とりあえず自前の環境ではちゃんと動いているが、きっと穴がいっぱいあるに違いない:-P"
114
+ expect(page).to have_content "今月も終わる"
115
+ expect(page).to have_no_content "今月も始まる"
116
116
  }
117
117
  end
118
118
  end
@@ -8,8 +8,8 @@ feature 'リンク元の表示', exclude_selenium: true do
8
8
  today = Date.today.strftime("%Y年%m月%d日")
9
9
  page.find('h2', text: today).click_link today
10
10
  within('div.day') {
11
- page.should have_css('div[class="refererlist"]')
12
- within('div.refererlist') { page.should have_content "http://www.example.com" }
11
+ expect(page).to have_css('div[class="refererlist"]')
12
+ within('div.refererlist') { expect(page).to have_content "http://www.example.com" }
13
13
  }
14
14
  end
15
15
 
@@ -18,7 +18,7 @@ feature 'リンク元の表示', exclude_selenium: true do
18
18
  visit "/"
19
19
  today = Date.today.strftime("%Y年%m月%d日")
20
20
  page.find('h2', text: today).click_link today
21
- within('div.day div.refererlist') { page.should have_link "http://www.example.com" }
21
+ within('div.day div.refererlist') { expect(page).to have_link "http://www.example.com" }
22
22
  end
23
23
  end
24
24
 
@@ -26,19 +26,19 @@ describe PStore, "auto convert library" do
26
26
 
27
27
  it "should convert an encoding to UTF-8 automatically" do
28
28
  PStore.new(@dbfile).transaction do |db|
29
- db["key1"].encoding.should == Encoding::UTF_8
30
- db["key2"].should == 2
31
- db["key3"][2].encoding.should == Encoding::UTF_8
29
+ expect(db["key1"].encoding).to eq(Encoding::UTF_8)
30
+ expect(db["key2"]).to eq(2)
31
+ expect(db["key3"][2].encoding).to eq(Encoding::UTF_8)
32
32
  end
33
33
  end
34
34
 
35
35
  it "1回目のtransactionではMashal.loadが3回呼ばれる" do
36
- Marshal.should_receive(:load).exactly(3).and_return({})
36
+ expect(Marshal).to receive(:load).exactly(3).and_return({})
37
37
  PStore.new(@dbfile).transaction {}
38
38
  end
39
39
 
40
40
  it "2回目のtransactionではMashal.loadが1回だけ呼ばれる" do
41
- Marshal.should_receive(:load).exactly(4).and_return({})
41
+ expect(Marshal).to receive(:load).exactly(4).and_return({})
42
42
  PStore.new(@dbfile).transaction {}
43
43
  PStore.new(@dbfile).transaction {}
44
44
  end
@@ -20,13 +20,13 @@ describe TDiary::Configuration do
20
20
  @obj = TDiary.configuration
21
21
  end
22
22
 
23
- it { @obj.class.should eq TDiary::Configuration }
23
+ it { expect(@obj.class).to eq TDiary::Configuration }
24
24
  it "singleton" do
25
- @obj.should eq TDiary.configuration
25
+ expect(@obj).to eq TDiary.configuration
26
26
  end
27
27
  end
28
28
 
29
29
  it "TDiary.configuration.attribute" do
30
- TDiary.configuration.style.should == "Wiki"
30
+ expect(TDiary.configuration.style).to eq("Wiki")
31
31
  end
32
32
  end
@@ -6,15 +6,15 @@ require 'tdiary/core_ext'
6
6
  describe "core extension library" do
7
7
  describe 'String#make_link' do
8
8
  it 'エスケープされて出力される' do
9
- "<\"alice&bob\">".make_link.should eq "&lt;&quot;alice&amp;bob&quot;&gt;"
9
+ expect("<\"alice&bob\">".make_link).to eq "&lt;&quot;alice&amp;bob&quot;&gt;"
10
10
  end
11
11
 
12
12
  context 'httpを含む場合' do
13
- it { "http://example.com".make_link.should eq "<a href=\"http://example.com\">http://example.com</a>" }
13
+ it { expect("http://example.com".make_link).to eq "<a href=\"http://example.com\">http://example.com</a>" }
14
14
  end
15
15
 
16
16
  context 'メールアドレスのようなものを含む場合' do
17
- it { "shibata.hiroshi@gmail.com".make_link.should eq "<a href=\"mailto:shibata.hiroshi@gmail.com\">shibata.hiroshi@gmail.com</a>" }
17
+ it { expect("shibata.hiroshi@gmail.com".make_link).to eq "<a href=\"mailto:shibata.hiroshi@gmail.com\">shibata.hiroshi@gmail.com</a>" }
18
18
  end
19
19
  end
20
20
 
@@ -22,21 +22,21 @@ describe "core extension library" do
22
22
  context "emojify" do
23
23
  before { @result = ":sushi: は美味しい".emojify }
24
24
  it do
25
- @result.should eq "<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/sushi.png' width='20' height='20' title='sushi' alt='sushi' class='emoji' /> は美味しい"
25
+ expect(@result).to eq "<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/sushi.png' width='20' height='20' title='sushi' alt='sushi' class='emoji' /> は美味しい"
26
26
  end
27
27
  end
28
28
 
29
29
  context "大文字でもemojify" do
30
30
  before { @result = ":SUSHI: は美味しい".emojify }
31
31
  it do
32
- @result.should eq "<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/sushi.png' width='20' height='20' title='sushi' alt='sushi' class='emoji' /> は美味しい"
32
+ expect(@result).to eq "<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/sushi.png' width='20' height='20' title='sushi' alt='sushi' class='emoji' /> は美味しい"
33
33
  end
34
34
  end
35
35
 
36
36
  context "+1でもemojify" do
37
37
  before { @result = "いいね!:+1:".emojify }
38
38
  it do
39
- @result.should eq "いいね!<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/plus1.png' width='20' height='20' title='plus1' alt='plus1' class='emoji' />"
39
+ expect(@result).to eq "いいね!<img src='http://www.emoji-cheat-sheet.com/graphics/emojis/plus1.png' width='20' height='20' title='plus1' alt='plus1' class='emoji' />"
40
40
  end
41
41
  end
42
42
 
@@ -45,7 +45,7 @@ describe "core extension library" do
45
45
  @result = ":<script type='text/javascript'></script>: は美味しい".emojify
46
46
  end
47
47
  it do
48
- @result.should eq ":<script type='text/javascript'></script>: は美味しい"
48
+ expect(@result).to eq ":<script type='text/javascript'></script>: は美味しい"
49
49
  end
50
50
  end
51
51
  end
@@ -5,7 +5,7 @@ require 'tdiary/io/default'
5
5
 
6
6
  describe TDiary::IO::Default do
7
7
  it 'is_a TDiary::IO::Base' do
8
- expect { TDiary::IO::Default.is_a?(TDiary::IO::Base) }.to be_true
8
+ expect { TDiary::IO::Default.is_a?(TDiary::IO::Base) }.to be_truthy
9
9
  end
10
10
 
11
11
  describe "#save_cgi_conf and #load_cgi_conf" do