Skip to content

Commit df3c858

Browse files
committedMay 15, 2019
RSpec修正、Travis CI でのエラー対応見直し
1 parent f7aeeef commit df3c858

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed
 

‎.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ deploy:
1414
- bundle exec rails db:seed
1515
- bundle exec rails dojos:update_db_by_yaml
1616
- bundle exec rails dojo_event_services:upsert
17-
- bundle exec rails soundcloud_tracks:upsert
1817
cache:
1918
- bundler
2019
before_install:

‎spec/features/podcasts_spec.rb

+21-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
11
require 'rails_helper'
22

3-
RSpec.feature "Podcasts", type: :feature do
4-
describe "GET documents" do
5-
scenario "Podcast index should be exist" do
6-
visit "/podcasts"
3+
RSpec.feature 'Podcasts', type: :feature do
4+
describe 'GET documents' do
5+
scenario 'Podcast index should be exist' do
6+
visit '/podcasts'
77
expect(page).to have_http_status(:success)
88
end
99

10-
scenario "Charter should be exist" do
11-
visit "/podcasts/1"
10+
scenario 'Charter should be exist' do
11+
@soundcloud_track = create(:soundcloud_track)
12+
allow(@soundcloud_track).to receive(:exists?) { true }
13+
allow(@soundcloud_track).to receive(:exists?).with(offset: -1) { false }
14+
allow(@soundcloud_track).to receive(:content) { "title\n収録日: 2019/05/10\n..." }
15+
allow(SoundCloudTrack).to receive(:find_by).with(id: @soundcloud_track.id.to_s) { @soundcloud_track }
16+
17+
visit "/podcasts/#{@soundcloud_track.id}"
1218
target = '← 目次へ'
1319
expect(page).to have_http_status(:success)
14-
expect(page).to have_link target, href: "/podcasts"
20+
expect(page).to have_link target, href: '/podcasts'
1521
click_link target
1622
expect(page).to have_http_status(:success)
1723
end
1824

19-
scenario "Load doc file with absolute path" do
20-
visit "/podcasts/10"
25+
scenario 'Load doc file with absolute path' do
26+
@soundcloud_track = create(:soundcloud_track)
27+
allow(@soundcloud_track).to receive(:exists?) { true }
28+
allow(@soundcloud_track).to receive(:content) { "title\n収録日: 2019/05/10\n..." }
29+
allow(SoundCloudTrack).to receive(:find_by).with(id: @soundcloud_track.id.to_s) { @soundcloud_track }
30+
31+
visit "/podcasts/#{@soundcloud_track.id}"
2132
target = '目次へ戻る'
2233
expect(page).to have_http_status(:success)
23-
expect(page).to have_link target, href: "/podcasts"
34+
expect(page).to have_link target, href: '/podcasts'
2435
click_link target
2536
expect(page).to have_http_status(:success)
2637
end

0 commit comments

Comments
 (0)
Please sign in to comment.