|
5 | 5 | let(:url) { 'http://foo.com' }
|
6 | 6 | let(:png_url) { 'http://foo.com/foo.png' }
|
7 | 7 | let(:video_url) { 'http://foo.com/foo.swf' }
|
| 8 | + let(:favicon) { 'http://foo.com/foo.ico' } |
8 | 9 | let(:png) { File.open(File.dirname(__FILE__) + '/fixtures/foo.png') }
|
9 | 10 | let(:action) { LinkThumbnailer.generate(url) }
|
10 | 11 |
|
|
22 | 23 |
|
23 | 24 | let(:html) { File.open(File.dirname(__FILE__) + '/fixtures/og_valid_example.html').read() }
|
24 | 25 |
|
| 26 | + it { expect(action.favicon).to eq(favicon) } |
25 | 27 | it { expect(action.title).to eq(title) }
|
26 | 28 | it { expect(action.description).to eq(description) }
|
27 | 29 | it { expect(action.images.count).to eq(1) }
|
|
42 | 44 | stub_request(:get, png_url_2).to_return(status: 200, body: png_2, headers: {})
|
43 | 45 | end
|
44 | 46 |
|
| 47 | + it { expect(action.favicon).to eq('') } |
45 | 48 | it { expect(action.title).to eq(title) }
|
46 | 49 | it { expect(action.description).to eq(description) }
|
47 | 50 | it { expect(action.images.count).to eq(2) }
|
|
55 | 58 | let(:video_url_2) { 'http://foo.com/bar.swf' }
|
56 | 59 | let(:html) { File.open(File.dirname(__FILE__) + '/fixtures/og_valid_multi_video_example.html').read() }
|
57 | 60 |
|
| 61 | + it { expect(action.favicon).to eq('') } |
58 | 62 | it { expect(action.title).to eq(title) }
|
59 | 63 | it { expect(action.description).to eq(description) }
|
60 | 64 | it { expect(action.videos.count).to eq(2) }
|
|
84 | 88 | let(:title) { 'Title from meta' }
|
85 | 89 | let(:description) { 'Description from meta' }
|
86 | 90 |
|
| 91 | + it { expect(action.favicon).to eq(favicon) } |
87 | 92 | it { expect(action.title).to eq(title) }
|
88 | 93 | it { expect(action.description).to eq(description) }
|
89 | 94 |
|
|
94 | 99 | let(:html) { File.open(File.dirname(__FILE__) + '/fixtures/default_from_body.html').read() }
|
95 | 100 | let(:description) { 'Description from body' }
|
96 | 101 |
|
| 102 | + it { expect(action.favicon).to eq(favicon) } |
97 | 103 | it { expect(action.description).to eq(description) }
|
98 | 104 | it { expect(action.images.count).to eq(1) }
|
99 | 105 | it { expect(action.images.first.src.to_s).to eq(png_url) }
|
|
0 commit comments