diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index b3e6d316..b8a2656a 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -10,26 +10,27 @@ require 'spec_helper' # end # end # end -describe ApplicationHelper do +describe ApplicationHelper, type: :helper do + subject{ helper } describe "onload_javascript" do it "should add a normal string when given" do - onload_javascript "alert('hi')" - onload_javascript.should == "alert('hi')" + subject.onload_javascript "alert('hi')" + subject.onload_javascript.should == "alert('hi')" end it "should concatenate separate statements correctly" do - onload_javascript "alert('hi')" - onload_javascript "alert('ho')" - onload_javascript.should == "alert('hi');alert('ho')" + subject.onload_javascript "alert('hi')" + subject.onload_javascript "alert('ho')" + subject.onload_javascript.should == "alert('hi');alert('ho')" end it "should accept a block as argument" do - onload_javascript do + subject.onload_javascript do "alert('hi')" end - onload_javascript.should == "alert('hi')" + subject.onload_javascript.should == "alert('hi')" end it "should accept a lambda as argument" do - onload_javascript ->{ "alert('hi')" } - onload_javascript.should == "alert('hi')" + subject.onload_javascript ->{ "alert('hi')" } + subject.onload_javascript.should == "alert('hi')" end end end