|
80 | 80 | end
|
81 | 81 | end
|
82 | 82 |
|
83 |
| - describe '#update_playlist_duration' do |
| 83 | + describe '#save_playlist_duration' do |
84 | 84 | let(:playlist) { create(:playlist) }
|
85 | 85 |
|
86 |
| - before { allow(playlist).to receive(:update_duration) } |
| 86 | + before { allow(playlist).to receive(:save_duration) } |
87 | 87 |
|
88 | 88 | describe 'after create' do
|
89 |
| - it 'calls update_duration on the parent playlist' do |
| 89 | + it 'calls save_duration on the parent playlist' do |
90 | 90 | playlist_track = build(:playlist_track, playlist:)
|
91 | 91 | playlist_track.save
|
92 |
| - expect(playlist).to have_received(:update_duration) |
| 92 | + expect(playlist).to have_received(:save_duration) |
93 | 93 | end
|
94 | 94 | end
|
95 | 95 |
|
96 | 96 | describe 'after update' do
|
97 |
| - before { allow(playlist).to receive(:update_duration) } |
| 97 | + before { allow(playlist).to receive(:save_duration) } |
98 | 98 |
|
99 |
| - it 'calls update_duration on the parent playlist' do |
| 99 | + it 'calls save_duration on the parent playlist' do |
100 | 100 | playlist_track = create(:playlist_track, playlist:)
|
101 | 101 | playlist_track.update(starts_at_second: 3, ends_at_second: 5)
|
102 |
| - expect(playlist).to have_received(:update_duration).twice |
| 102 | + expect(playlist).to have_received(:save_duration).twice |
103 | 103 | end
|
104 | 104 | end
|
105 | 105 |
|
106 | 106 | describe 'after destroy' do
|
107 |
| - before { allow(playlist).to receive(:update_duration) } |
| 107 | + before { allow(playlist).to receive(:save_duration) } |
108 | 108 |
|
109 |
| - it 'calls update_duration on the parent playlist' do |
| 109 | + it 'calls save_duration on the parent playlist' do |
110 | 110 | playlist_track = create(:playlist_track, playlist:)
|
111 | 111 | playlist_track.destroy
|
112 |
| - expect(playlist).to have_received(:update_duration).twice |
| 112 | + expect(playlist).to have_received(:save_duration).twice |
113 | 113 | end
|
114 | 114 | end
|
115 | 115 | end
|
|
0 commit comments