File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 98
98
expect ( page ) . to have_link '05:45' , href : 'https://youtu.be/test123?t=05m45s'
99
99
expect ( page ) . to have_link '59:59' , href : 'https://youtu.be/test123?t=59m59s'
100
100
end
101
+
102
+ scenario 'Show note timestamps with m:ss format (single digit minutes) are converted to YouTube links' do
103
+ @podcast = create ( :podcast )
104
+ allow ( @podcast ) . to receive ( :exist? ) { true }
105
+ allow ( @podcast ) . to receive ( :content ) {
106
+ <<~CONTENT
107
+ タイトル
108
+ 収録日: 2019/05/10
109
+
110
+ YouTubeリンク: https://www.youtube.com/watch?v=episode21
111
+
112
+ ## Shownote
113
+
114
+ - 0:00 ゲスト自己紹介
115
+ - 0:54 TFabWorks 無償レンタルプログラム
116
+ - 2:10 2019年の年末から動き出した
117
+ - 9:25 レンタルの種類
118
+ CONTENT
119
+ }
120
+ allow ( Podcast ) . to receive ( :find_by ) . with ( id : @podcast . id . to_s ) { @podcast }
121
+
122
+ visit "/podcasts/#{ @podcast . id } "
123
+ expect ( page ) . to have_http_status ( :success )
124
+
125
+ # m:ss形式(一桁の分)のタイムスタンプもYouTubeリンクに変換されているか確認
126
+ expect ( page ) . to have_link '0:00' , href : 'https://youtu.be/episode21?t=0m00s'
127
+ expect ( page ) . to have_link '0:54' , href : 'https://youtu.be/episode21?t=0m54s'
128
+ expect ( page ) . to have_link '2:10' , href : 'https://youtu.be/episode21?t=2m10s'
129
+ expect ( page ) . to have_link '9:25' , href : 'https://youtu.be/episode21?t=9m25s'
130
+ end
101
131
end
102
132
end
You can’t perform that action at this time.
0 commit comments