|
18 | 18 | it "produces the correct script tag" do |
19 | 19 | expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/) |
20 | 20 | end |
21 | | - it "produces the correct noscript tag" do |
| 21 | + it "produces the correct noscript tag" do |
22 | 22 | expect(output).to match(/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/) |
23 | 23 | end |
24 | 24 | end |
|
30 | 30 | it "produces the correct script tag" do |
31 | 31 | expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/) |
32 | 32 | end |
33 | | - it "produces the correct noscript tag" do |
| 33 | + it "produces the correct noscript tag" do |
34 | 34 | expect(output).to match(/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/) |
35 | 35 | end |
36 | 36 | end |
|
42 | 42 | it "produces the correct script tag" do |
43 | 43 | expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/) |
44 | 44 | end |
45 | | - it "produces the correct noscript tag" do |
| 45 | + it "produces the correct noscript tag" do |
46 | 46 | expect(output).to match(/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/) |
47 | 47 | end |
48 | 48 | end |
|
56 | 56 | it "produces the correct script tag" do |
57 | 57 | expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js\?file=#{filename}">\s<\/script>/) |
58 | 58 | end |
59 | | - it "produces the correct noscript tag" do |
| 59 | + it "produces the correct noscript tag" do |
60 | 60 | expect(output).to match(/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/) |
61 | 61 | end |
62 | 62 | end |
|
74 | 74 | it "produces the correct script tag" do |
75 | 75 | expect(output).to match(/<script src="https:\/\/gist.github.com\/#{doc.data['gist_id']}.js">\s<\/script>/) |
76 | 76 | end |
77 | | - it "produces the correct noscript tag" do |
| 77 | + it "produces the correct noscript tag" do |
78 | 78 | expect(output).to match(/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/) |
79 | 79 | end |
80 | 80 | end |
|
97 | 97 | expect(output).to match(/<script src="https:\/\/gist.github.com\/#{doc.data['gist_id']}.js\?file=#{doc.data['gist_filename']}">\s<\/script>/) |
98 | 98 | end |
99 | 99 |
|
100 | | - it "produces the correct noscript tag" do |
| 100 | + it "produces the correct noscript tag" do |
101 | 101 | expect(output).to match(/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/) |
102 | 102 | end |
103 | 103 | end |
104 | 104 |
|
105 | | - context "with valid gist id and invalid filename" do |
| 105 | + context "with valid gist id and invalid filename" do |
106 | 106 | before { stub_request(:get, "https://gist.githubusercontent.com/#{gist_id}/raw/#{gist_filename}").to_return(status: 404) } |
107 | 107 | let(:gist_id) { "mattr-/24081a1d93d2898ecf0f" } |
108 | 108 | let(:gist_filename) { "myfile.ext" } |
|
112 | 112 | expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist_id}.js\?file=#{gist_filename}">\s<\/script>/) |
113 | 113 | end |
114 | 114 |
|
115 | | - it "does not produce the noscript tag" do |
| 115 | + it "does not produce the noscript tag" do |
116 | 116 | expect(output).to_not match(/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/) |
117 | 117 | end |
118 | 118 |
|
119 | 119 | end |
120 | 120 |
|
121 | | - end |
| 121 | + context "with noscript disabled" do |
| 122 | + let(:doc) { doc_with_content(content, { "gist" => { "noscript" => false } }) } |
| 123 | + let(:output) do |
| 124 | + doc.content = content |
| 125 | + doc.output = Jekyll::Renderer.new(doc.site, doc).run |
| 126 | + end |
| 127 | + let(:gist) { "mattr-/24081a1d93d2898ecf0f" } |
122 | 128 |
|
| 129 | + it "does not produce the noscript tag" do |
| 130 | + expect(output).to_not match(/<noscript>/) |
| 131 | + end |
| 132 | + end |
| 133 | + |
| 134 | + end |
123 | 135 |
|
124 | 136 | context "invalid gist" do |
125 | 137 |
|
|
0 commit comments