spec/jelly/jelly_helper_spec.rb in honkster-jelly-0.11.0 vs spec/jelly/jelly_helper_spec.rb in honkster-jelly-0.12.0
- old
+ new
@@ -64,21 +64,20 @@
["MyComponent", 'arg1', 'arg2', 'arg3'],
["MyComponent", 'arg1', 'arg2', 'arg5'],
]
end
- it "adds a call to Jelly.attach in an jQuery(document).ready block" do
+ it "adds a call to Jelly.attach" do
helper.attach_javascript_component("MyComponent", 'arg1', 'arg2', 'arg3')
expected_args = ['arg1','arg2','arg3'].to_json
helper.instance_variable_get(:@jelly_attachments).should == [
["MyComponent", 'arg1', 'arg2', 'arg3']
]
html = helper.spread_jelly
doc = Nokogiri::HTML(html)
document_ready_tag = doc.at("script")
- document_ready_tag.inner_html.should include("jQuery(document).ready(function() {")
- document_ready_part = document_ready_tag.inner_html.split("\n")[3]
+ document_ready_part = document_ready_tag.inner_html.split("\n")[2]
arguments = jelly_attach_arguments(document_ready_part)
arguments.should include(["MyComponent", 'arg1', 'arg2', 'arg3'])
end
end
\ No newline at end of file