spec/unit/form_builder_spec.rb in activeadmin-0.3.4 vs spec/unit/form_builder_spec.rb in activeadmin-0.4.0

- old
+ new

@@ -63,24 +63,18 @@ :value => "Another Button" }) end end context "when polymorphic relationship" do - - let(:body) do - comment = ActiveAdmin::Comment.new - - active_admin_form_for comment, :url => "admins/comments" do |f| - f.inputs :resource - end - + it "should raise error" do + lambda { + comment = ActiveAdmin::Comment.new + active_admin_form_for comment, :url => "admins/comments" do |f| + f.inputs :resource + end + }.should raise_error(Formtastic::PolymorphicInputWithoutCollectionError) end - - it "should not generate any field" do - body.should have_tag("form", :attributes => { :method => 'post' }) - body.should_not have_tag("select") - end end describe "passing in options" do let :body do build_form :html => { :multipart => true } do |f| @@ -213,10 +207,10 @@ context "with wrapper html" do it "should set a class" do body = build_form do |f| f.input :title, :wrapper_html => { :class => "important" } end - body.should have_tag("li", :attributes => {:class => "string optional important"}) + body.should have_tag("li", :attributes => {:class => "important string input optional stringish"}) end end {