require 'minitest/autorun'
require 'vueck'
class VueCKTest < Minitest::Test
CSS = ["200", {"Content-Type"=>"text/css", "Content-Length"=>"32"}, [".dogs{color:red}.post{color:red}"]]
JS = ["200",{"Content-Type"=>"application/javascript", "Content-Length"=>"691"},[%q{var one_lang_and_no_style = Vue.component('one_lang_and_no_style',{template:'
Other Guy
Oh hai mark
', props: ["test"], data: { adam: true, drew: true }, methods: { yo: function() { } } });var two_langs = Vue.component('two_langs',{template:'Are Cool
', props: ["test"], data: { adam: true, drew: true }, methods: { yo: function() { } } });var default_langs = Vue.component('default_langs',{template:' Oh hai mark props: ["test"], data: { adam: true }, methods: { yo: function() { return this.adam; } } .post { color: red; } ', props: ["test"], data: { adam: true }, methods: { yo: function() { return this.adam; } } });}]]
def test_render_css
plugin = VueCK::Plugin.new()
response = plugin.call({"PATH_INFO"=>"/vue/vue.css", "REQUEST_METHOD"=>"GET"})
assert response == CSS
end
def test_render_js
plugin = VueCK::Plugin.new()
response = plugin.call({"PATH_INFO"=>"/vue/vue.js", "REQUEST_METHOD"=>"GET"})
assert response == JS
end
end