|
45 | 45 | it {expect{url.resource}.to raise_error Yt::Errors::NoItems } |
46 | 46 | end |
47 | 47 |
|
48 | | - # # TODO: need to fix our code, as YouTube behavior changes |
49 | | - # context 'given a YouTube channel URL in the name form' do |
50 | | - # let(:text) { "http://www.youtube.com/#{name}" } |
51 | | - |
52 | | - # describe 'works when the name matches the custom URL' do |
53 | | - # let(:name) { 'nbcsports' } |
54 | | - # it {expect(url.id).to eq 'UCqZQlzSHbVJrwrn5XvzrzcA' } |
55 | | - # end |
56 | | - |
57 | | - # describe 'works when the name matches the username' do |
58 | | - # let(:name) { '2012NBCOlympics' } |
59 | | - # it {expect(url.id).to eq 'UCqZQlzSHbVJrwrn5XvzrzcA' } |
60 | | - # end |
61 | | - |
62 | | - # describe 'fails with unknown channels' do |
63 | | - # let(:name) { 'not-an-actual-channel' } |
64 | | - # it {expect{url.id}.to raise_error Yt::Errors::NoItems } |
65 | | - # end |
66 | | - # end |
67 | | - |
68 | | - # context 'given a YouTube channel URL in the custom form' do |
69 | | - # let(:text) { "https://youtube.com/c/#{name}" } |
70 | | - |
71 | | - # describe 'works with existing channels' do |
72 | | - # let(:name) { 'ogeeku' } |
73 | | - # it {expect(url.id).to eq 'UC4nG_NxJniKoB-n6TLT2yaw' } |
74 | | - # end |
75 | | - |
76 | | - # describe 'fails with unknown channels' do |
77 | | - # let(:name) { 'not-an-actual-channel' } |
78 | | - # it {expect{url.id}.to raise_error Yt::Errors::NoItems } |
79 | | - # end |
80 | | - # end |
81 | | - |
82 | | - # context 'given a YouTube channel URL in the username form' do |
83 | | - # let(:text) { "youtube.com/user/#{name}" } |
84 | | - |
85 | | - # describe 'works with existing channels' do |
86 | | - # let(:name) { 'ogeeku' } |
87 | | - # it {expect(url.id).to eq 'UC4lU5YG9QDgs0X2jdnt7cdQ' } |
88 | | - # end |
89 | | - |
90 | | - # describe 'fails with unknown channels' do |
91 | | - # let(:name) { 'not-an-actual-channel' } |
92 | | - # it {expect{url.id}.to raise_error Yt::Errors::NoItems } |
93 | | - # end |
94 | | - # end |
| 48 | + context 'given a YouTube channel URL in the name form' do |
| 49 | + let(:text) { "http://www.youtube.com/#{name}" } |
| 50 | + |
| 51 | + describe 'works when the name matches the custom URL' do |
| 52 | + let(:name) { 'nbcsports' } |
| 53 | + it {expect(url.id).to eq 'UCqZQlzSHbVJrwrn5XvzrzcA' } |
| 54 | + end |
| 55 | + |
| 56 | + describe 'works when the name matches the username' do |
| 57 | + let(:name) { '2012NBCOlympics' } |
| 58 | + it {expect(url.id).to eq 'UCqZQlzSHbVJrwrn5XvzrzcA' } |
| 59 | + end |
| 60 | + |
| 61 | + describe 'fails with unknown channels' do |
| 62 | + let(:name) { 'not-an-actual-channel' } |
| 63 | + it {expect{url.id}.to raise_error Yt::Errors::NoItems } |
| 64 | + end |
| 65 | + end |
| 66 | + |
| 67 | + context 'given a YouTube channel URL in the custom form' do |
| 68 | + let(:text) { "https://youtube.com/c/#{name}" } |
| 69 | + |
| 70 | + describe 'works with existing channels' do |
| 71 | + let(:name) { 'ogeeku' } |
| 72 | + it {expect(url.id).to eq 'UC4nG_NxJniKoB-n6TLT2yaw' } |
| 73 | + end |
| 74 | + |
| 75 | + describe 'fails with unknown channels' do |
| 76 | + let(:name) { 'not-an-actual-channel' } |
| 77 | + it {expect{url.id}.to raise_error Yt::Errors::NoItems } |
| 78 | + end |
| 79 | + end |
| 80 | + |
| 81 | + context 'given a YouTube channel URL in the username form' do |
| 82 | + let(:text) { "youtube.com/user/#{name}" } |
| 83 | + |
| 84 | + describe 'works with existing channels' do |
| 85 | + let(:name) { 'ogeeku' } |
| 86 | + it {expect(url.id).to eq 'UC4lU5YG9QDgs0X2jdnt7cdQ' } |
| 87 | + end |
| 88 | + |
| 89 | + describe 'fails with unknown channels' do |
| 90 | + let(:name) { 'not-an-actual-channel' } |
| 91 | + it {expect{url.id}.to raise_error Yt::Errors::NoItems } |
| 92 | + end |
| 93 | + end |
95 | 94 | end |
0 commit comments