require 'spec_helper' describe Picky::Helper do describe "cached_interface" do it "should return good html" do Picky::Helper.cached_interface.should == Picky::Helper.interface end it "should respect the options" do Picky::Helper.cached_interface(:more => 'bla').should_not == Picky::Helper.interface(:more => 'blu') end it "should return the cached interface" do Picky::Helper.cached_interface.object_id.should == Picky::Helper.cached_interface.object_id end it "should be frozen" do Picky::Helper.cached_interface.should be_frozen end end describe "input" do it "should return good html" do Picky::Helper.input.should == "
\n
\n \n \n \n
\n" end it "should return good html" do Picky::Helper.input(:button => 'find').should == "
\n
\n \n \n \n
\n" end end describe "results" do it "should return good html" do Picky::Helper.input.should == "
\n
\n \n \n \n
\n" end it "should return good html" do Picky::Helper.input(:no_results => 'SORRY!', :more => 'Click for more!').should == "
\n
\n \n \n \n
\n" end end describe "interface" do it "should return good html" do Picky::Helper.interface.should == "
\n
\n
\n \n \n \n
\n\n
\n
Sorry, no results found!
\n
\n
    \n
      more
    \n
      \n
      \n\n
      \n" end it "should return good html" do Picky::Helper.interface(:button => 'find', :no_results => 'SORRY!', :more => 'Click for more!').should == "
      \n
      \n
      \n \n \n \n
      \n\n
      \n
      SORRY!
      \n
      \n
        \n
          Click for more!
        \n
          \n
          \n\n
          \n" end end end