require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb') describe JellyHelper, :type => :helper do after do helper.jelly_clear_ops() end def parse_jelly_ops(html) JSON.parse(Regexp.new('Jelly\.run\.apply\(Jelly, (.*)\);').match(html)[1]) end describe "#spread_jelly" do before do stub_controller = mock! do |controller| controller.controller_path { 'my_fun_controller' } controller.action_name { 'super_good_action' } end stub(helper).controller { stub_controller } end it "should create a javascript include tag that attaches the Jelly.Location and Jelly.Page components" do output = helper.spread_jelly output.should include('