summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2014-07-08 00:21:21 -0600
committerDan Allen <dan.j.allen@gmail.com>2014-07-08 00:48:33 -0600
commit51eb091b71737af12497f443fce08e7b952dd68e (patch)
tree5bccd2e729154714a0e435d2fc65acb851b07358 /test
parentad9d190ac52b161ce8b724d1856dfe9a206ff7b9 (diff)
use https scheme for assets by default
- use https scheme for assets by default - allow URI scheme for assets to be controlled by asset-uri-scheme - upgrade highlightjs to 8.0, remove unnecessary JavaScript resource - load MathJax 2.4.0 from cdnjs - load FontAwesome 4.1.0 from cdnjs - add tests for asset-uri-scheme
Diffstat (limited to 'test')
-rw-r--r--test/blocks_test.rb36
1 files changed, 35 insertions, 1 deletions
diff --git a/test/blocks_test.rb b/test/blocks_test.rb
index f8fa26eb..a906cc3c 100644
--- a/test/blocks_test.rb
+++ b/test/blocks_test.rb
@@ -1870,9 +1870,43 @@ You can use icons for admonitions by setting the 'icons' attribute.
EOS
output = render_string input, :safe => Asciidoctor::SafeMode::SERVER
- assert_css 'html > head > link[rel="stylesheet"][href="http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"]', output, 1
+ assert_css 'html > head > link[rel="stylesheet"][href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"]', output, 1
assert_xpath '//*[@class="admonitionblock tip"]//*[@class="icon"]/i[@class="fa fa-tip"]', output, 1
end
+
+ test 'should use http uri scheme for assets when asset-uri-scheme is http' do
+ input = <<-EOS
+:asset-uri-scheme: http
+:icons: font
+:source-highlighter: highlightjs
+
+TIP: You can control the URI scheme used for assets with the asset-uri-scheme attribute
+
+[source,ruby]
+puts "AsciiDoc, FTW!"
+ EOS
+
+ output = render_string input, :safe => Asciidoctor::SafeMode::SAFE
+ assert_css 'html > head > link[rel="stylesheet"][href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"]', output, 1
+ assert_css 'html > head > script[src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.0/highlight.min.js"]', output, 1
+ end
+
+ test 'should use no uri scheme for assets when asset-uri-scheme is blank' do
+ input = <<-EOS
+:asset-uri-scheme:
+:icons: font
+:source-highlighter: highlightjs
+
+TIP: You can control the URI scheme used for assets with the asset-uri-scheme attribute
+
+[source,ruby]
+puts "AsciiDoc, FTW!"
+ EOS
+
+ output = render_string input, :safe => Asciidoctor::SafeMode::SAFE
+ assert_css 'html > head > link[rel="stylesheet"][href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"]', output, 1
+ assert_css 'html > head > script[src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.0/highlight.min.js"]', output, 1
+ end
end
context 'Image paths' do