require 'spec_helper'
describe ActionView::Helpers::FormHelper do
before do
helper.form_for(FakeModel.new, :url => "myurl", :builder => Manageable::Helpers::FormBuilder) do |f|
@text_field = f.text_field(:name)
@password_field = f.password_field(:name)
@telephone_field = f.telephone_field(:name)
@url_field = f.url_field(:name)
@email_field = f.email_field(:name)
@number_field = f.number_field(:name, :size => nil)
@range_field = f.range_field(:name, :size => nil)
@file_field = f.file_field(:name)
@text_area = f.text_area(:name)
@check_box = f.check_box(:name)
@radio_button = f.radio_button(:name, "Yes")
@group = f.group { "thegroup" }
@button = f.button("Save", :name => "Save", :type => :submit)
end
end
it "should print labeled text_field" do
@text_field.should == '
'
end
it "should print labeled password_field" do
@password_field.should == ''
end
it "should print labeled telephone_field" do
@telephone_field.should == ''
end
it "should print labeled url_field" do
@url_field.should == ''
end
it "should print labeled email_field" do
@email_field.should == ''
end
it "should print labeled number_field" do
@number_field.should == ''
end
it "should print labeled range_field" do
@range_field.should == ''
end
it "should print labeled file_field" do
@file_field.should == ''
end
it "should print labeled text_area" do
@text_area.should == ''
end
it "should print labeled check_box" do
@check_box.should == ''
end
it "should print labeled radio_button" do
@radio_button.should == ''
end
it "should print group" do
@group.should == 'thegroup
'
end
it "should print button" do
@button.should == ''
end
end