Skip to content

Commit

Permalink
add test with nested form but empty model to address #67 and #70
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Mar 17, 2014
1 parent ff93220 commit c711980
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/nested_form_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,17 @@ class AlbumForm < Reform::Form
form.to_hash.must_equal({"hit"=>{"title"=>"Downtown"}, "title" => "Blackhawks Over Los Angeles", "songs"=>[{"title"=>"Calling"}]})
end


it "creates nested forms" do
form.hit.must_be_kind_of Reform::Form
form.songs.must_be_kind_of Reform::Form::Forms
end
# describe "#initialize" do
# it "allows empty properties" do
# AlbumForm.new(OpenStruct.new)
# end
# end


describe "rendering" do
it { form.title.must_equal "Blackhawks Over Los Angeles" }
Expand Down

0 comments on commit c711980

Please sign in to comment.