require File.dirname(__FILE__) + "/../../../spec_helper.rb" describe RightRails::Helpers::Forms do include ActionView::Helpers::TagHelper include ActionView::Helpers::FormTagHelper include ActionView::Helpers::JavaScriptHelper include RightRails::Helpers::Basic include RightRails::Helpers::Forms def url_for(options) options end def escape_javascript(str) str end it "should generate a #calendar_field_tag" do calendar_field_tag('name', 'value').should == %Q{} @_right_scripts.should == ['calendar'] end it "should generate a #calendar_field_tag with options" do calendar_field_tag('name', 'value', :format => '%Y/%m/%d').should == %Q{} end it "should generate a #autocomplete_field_tag" do autocomplete_field_tag('name', 'value', :url => '/foo').should == %Q{} @_right_scripts.should == ['autocompleter'] end it "should generate a #autocomplete_field_tag with options" do autocomplete_field_tag('name', 'value', :url => '/foo', :spinner => 'spinner', :min_length => 2).should == %Q{} end it "should generate a #slider_tag with options" do slider_tag('some_field', 22, :min => 10, :max => 40).should == %Q{\n} end it "should generate a #rater_tag" do rater_tag('some_field', 2).should == %Q{\n} end it "should generate the #rater_display tag" do rater_display(4).should == %Q{
} end end