File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 4949 end
5050
5151 context "with file specified" do
52- before { stub_request ( :get , " https://gist.githubusercontent.com/#{ gist } /raw/#{ filename } " ) . to_return ( :body => http_output ) }
52+ before { stub_request ( :get , %r! https://gist.githubusercontent.com/#{ gist } /raw/.*! ) . to_return ( :body => http_output ) }
5353 let ( :gist ) { "mattr-/24081a1d93d2898ecf0f" }
5454 let ( :filename ) { "myfile.ext" }
5555 let ( :content ) { "{% gist #{ gist } #{ filename } %}" }
5656
5757 it "produces the correct script tag" do
58- expect ( output ) . to match ( %r!<script src="https:\/ \ / gist.github.com\ /#{ gist } .js\? file=#{ filename } ">\s <\/ script>! )
58+ expect ( output ) . to match ( %r!<script src="https:/ /gist.github.com/#{ gist } .js\? file=#{ filename } ">\s <\/ script>! )
5959 end
6060 it "produces the correct noscript tag" do
6161 expect ( output ) . to match ( %r!<noscript><pre><test>true<\/ test><\/ pre><\/ noscript>\n ! )
6262 end
63+
64+ context "with octothorpe in filename" do
65+ let ( :filename ) { "my#file" }
66+
67+ it "removes special characters from the filename" do
68+ expect ( output ) . to match ( %r!<script src="https://gist.github.com/#{ gist } .js\? file=myfile">\s </script>! )
69+ end
70+ end
6371 end
6472
6573 context "with variable gist id" do
You can’t perform that action at this time.
0 commit comments