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 49
49
end
50
50
51
51
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 ) }
53
53
let ( :gist ) { "mattr-/24081a1d93d2898ecf0f" }
54
54
let ( :filename ) { "myfile.ext" }
55
55
let ( :content ) { "{% gist #{ gist } #{ filename } %}" }
56
56
57
57
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>! )
59
59
end
60
60
it "produces the correct noscript tag" do
61
61
expect ( output ) . to match ( %r!<noscript><pre><test>true<\/ test><\/ pre><\/ noscript>\n ! )
62
62
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
63
71
end
64
72
65
73
context "with variable gist id" do
You can’t perform that action at this time.
0 commit comments