0
@@ -168,30 +168,30 @@ describe Mack::ViewHelpers::FormHelpers do
0
+ describe "select
_tag" do
0
it "should create a nested select tag for a model" do
0
- select
(:cop, :level).should == %{<select id="cop_level" name="cop[level]"></select>}
0
+ select
_tag(:cop, :level).should == %{<select id="cop_level" name="cop[level]"></select>}
0
it "should create a non-nested select tag for a simple model" do
0
- select
(:simple).should == %{<select id="simple" name="simple"></select>}
0
+ select
_tag(:simple).should == %{<select id="simple" name="simple"></select>}
0
it "should build the options from a given array of arrays" do
0
- select
(:simple, :options => @select_options).should == %{<select id="simple" name="simple"><option value="1" >one</option><option value="2" >two</option><option value="3" >three</option></select>}
0
+ select
_tag(:simple, :options => @select_options).should == %{<select id="simple" name="simple"><option value="1" >one</option><option value="2" >two</option><option value="3" >three</option></select>}
0
it "should build the options from a given hash" do
0
- select
(:simple, :options => {"one" => 1, "two" => 2, "three" => 3}).should == %{<select id="simple" name="simple"><option value="1" >one</option><option value="3" >three</option><option value="2" >two</option></select>}
0
+ select
_tag(:simple, :options => {"one" => 1, "two" => 2, "three" => 3}).should == %{<select id="simple" name="simple"><option value="1" >one</option><option value="3" >three</option><option value="2" >two</option></select>}
0
it "should mark an option as selected if the model has it seleceted" do
0
- select
(:cop, :level, :options => @select_options).should == %{<select id="cop_level" name="cop[level]"><option value="1" selected>one</option><option value="2" >two</option><option value="3" >three</option></select>}
0
+ select
_tag(:cop, :level, :options => @select_options).should == %{<select id="cop_level" name="cop[level]"><option value="1" selected>one</option><option value="2" >two</option><option value="3" >three</option></select>}
0
it "should mark an option as selected if the selected options is available" do
0
- select
(:simple, :options => @select_options, :selected => 1).should == %{<select id="simple" name="simple"><option value="1" selected>one</option><option value="2" >two</option><option value="3" >three</option></select>}
0
+ select
_tag(:simple, :options => @select_options, :selected => 1).should == %{<select id="simple" name="simple"><option value="1" selected>one</option><option value="2" >two</option><option value="3" >three</option></select>}
0
@@ -208,6 +208,7 @@ describe Mack::ViewHelpers::FormHelpers do
0
it "should create a non-nested text_area for just a symbol" do
0
text_area(:unknown).should == %{<textarea id="unknown" name="unknown"></textarea>}
0
+ text_area(:unknown, :value => "hi there").should == %{<textarea id="unknown" name="unknown">hi there</textarea>}
0
it "should create a nested text_area for a model with an empty value if value is false" do
0
@@ -278,18 +279,18 @@ Hello
0
+ describe "submit
_button" do
0
it "should build a simple submit tag" do
0
- submit
.should == %{<input type="submit" value="Submit" />}
0
+ submit
_button.should == %{<input type="submit" value="Submit" />}
0
it "should allow you to change the value" do
0
- submit
("Login").should == %{<input type="submit" value="Login" />}
0
+ submit
_button("Login").should == %{<input type="submit" value="Login" />}
0
it "should take options" do
0
- submit
("Login", {:class => :foo}).should == %{<input class="foo" type="submit" value="Login" />}
0
+ submit
_button("Login", {:class => :foo}).should == %{<input class="foo" type="submit" value="Login" />}
Comments
No one has commented yet.