|
11 | 11 | @podcast = create(:podcast) |
12 | 12 | allow(@podcast).to receive(:exist?) { true } |
13 | 13 | allow(@podcast).to receive(:exist?).with(offset: -1) { false } |
14 | | - allow(@podcast).to receive(:content) { "title\n収録日: 2019/05/10\n..." } |
| 14 | + allow(@podcast).to receive(:content) { "title\n収録日: 2019/05/10\nhttps://www.youtube.com/watch?v=test123\n..." } |
15 | 15 | allow(Podcast).to receive(:find_by).with(id: @podcast.id.to_s) { @podcast } |
16 | 16 |
|
17 | 17 | visit "/podcasts/#{@podcast.id}" |
|
26 | 26 | scenario 'Load doc file with absolute path' do |
27 | 27 | @podcast = create(:podcast) |
28 | 28 | allow(@podcast).to receive(:exist?) { true } |
29 | | - allow(@podcast).to receive(:content) { "title\n収録日: 2019/05/10\n..." } |
| 29 | + allow(@podcast).to receive(:content) { "title\n収録日: 2019/05/10\nhttps://www.youtube.com/watch?v=test123\n..." } |
30 | 30 | allow(Podcast).to receive(:find_by).with(id: @podcast.id.to_s) { @podcast } |
31 | 31 |
|
32 | 32 | visit "/podcasts/#{@podcast.id}" |
|
40 | 40 | scenario 'Show note timestamps are converted to YouTube links' do |
41 | 41 | @podcast = create(:podcast) |
42 | 42 | allow(@podcast).to receive(:exist?) { true } |
43 | | - allow(@podcast).to receive(:content) { |
| 43 | + allow(@podcast).to receive(:content) { |
44 | 44 | <<~CONTENT |
45 | 45 | タイトル |
46 | 46 | 収録日: 2019/05/10 |
47 | | - |
| 47 | +
|
48 | 48 | YouTubeリンク: https://www.youtube.com/watch?v=Dd9IYiF0R6E |
49 | | - |
| 49 | +
|
50 | 50 | ## Shownote |
51 | | - |
| 51 | +
|
52 | 52 | 00:00:00 米国系 IT 企業から CoderDojo へ、233台のノートPC寄贈 |
53 | 53 | 00:25:01 AI と遊んでみる回の動画 https://youtu.be/BYpa1CcYtss?t=1425 |
54 | 54 | 00:59:14 CASE Shinjuku 利用者と CoderDojo の繋がり |
|
59 | 59 |
|
60 | 60 | visit "/podcasts/#{@podcast.id}" |
61 | 61 | expect(page).to have_http_status(:success) |
62 | | - |
| 62 | + |
63 | 63 | # タイムスタンプがYouTubeリンクに変換されているか確認 |
64 | 64 | expect(page).to have_link '00:00:00', href: 'https://youtu.be/Dd9IYiF0R6E?t=00h00m00s' |
65 | 65 | expect(page).to have_link '00:25:01', href: 'https://youtu.be/Dd9IYiF0R6E?t=00h25m01s' |
66 | 66 | expect(page).to have_link '00:59:14', href: 'https://youtu.be/Dd9IYiF0R6E?t=00h59m14s' |
67 | 67 | expect(page).to have_link '01:00:57', href: 'https://youtu.be/Dd9IYiF0R6E?t=01h00m57s' |
68 | | - |
| 68 | + |
69 | 69 | # 既存のURL付きタイムスタンプはそのまま表示されること |
70 | 70 | expect(page).to have_content 'AI と遊んでみる回の動画 https://youtu.be/BYpa1CcYtss?t=1425' |
71 | 71 | expect(page).to have_content 'CASE Shinjuku の英語アクセスページ https://case-shinjuku.com/english' |
|
74 | 74 | scenario 'Show note timestamps with mm:ss format are converted to YouTube links' do |
75 | 75 | @podcast = create(:podcast) |
76 | 76 | allow(@podcast).to receive(:exist?) { true } |
77 | | - allow(@podcast).to receive(:content) { |
| 77 | + allow(@podcast).to receive(:content) { |
78 | 78 | <<~CONTENT |
79 | 79 | タイトル |
80 | 80 | 収録日: 2019/05/10 |
81 | | - |
| 81 | +
|
82 | 82 | YouTubeリンク: https://www.youtube.com/watch?v=test123 |
83 | | - |
| 83 | +
|
84 | 84 | ## Shownote |
85 | | - |
| 85 | +
|
86 | 86 | 00:30 オープニング |
87 | 87 | 05:45 メインテーマ |
88 | 88 | 59:59 エンディング |
|
92 | 92 |
|
93 | 93 | visit "/podcasts/#{@podcast.id}" |
94 | 94 | expect(page).to have_http_status(:success) |
95 | | - |
| 95 | + |
96 | 96 | # mm:ss形式のタイムスタンプもYouTubeリンクに変換されているか確認 |
97 | 97 | expect(page).to have_link '00:30', href: 'https://youtu.be/test123?t=00m30s' |
98 | 98 | expect(page).to have_link '05:45', href: 'https://youtu.be/test123?t=05m45s' |
|
102 | 102 | scenario 'Show note timestamps with m:ss format (single digit minutes) are converted to YouTube links' do |
103 | 103 | @podcast = create(:podcast) |
104 | 104 | allow(@podcast).to receive(:exist?) { true } |
105 | | - allow(@podcast).to receive(:content) { |
| 105 | + allow(@podcast).to receive(:content) { |
106 | 106 | <<~CONTENT |
107 | 107 | タイトル |
108 | 108 | 収録日: 2019/05/10 |
109 | | - |
| 109 | +
|
110 | 110 | YouTubeリンク: https://www.youtube.com/watch?v=episode21 |
111 | | - |
| 111 | +
|
112 | 112 | ## Shownote |
113 | | - |
| 113 | +
|
114 | 114 | 0:00 ゲスト自己紹介 |
115 | 115 | 0:54 TFabWorks 無償レンタルプログラム |
116 | 116 | 2:10 2019年の年末から動き出した |
|
121 | 121 |
|
122 | 122 | visit "/podcasts/#{@podcast.id}" |
123 | 123 | expect(page).to have_http_status(:success) |
124 | | - |
| 124 | + |
125 | 125 | # m:ss形式(一桁の分)のタイムスタンプもYouTubeリンクに変換されているか確認 |
126 | 126 | expect(page).to have_link '0:00', href: 'https://youtu.be/episode21?t=0m00s' |
127 | 127 | expect(page).to have_link '0:54', href: 'https://youtu.be/episode21?t=0m54s' |
|
0 commit comments