spec/unit/comments_spec.rb in activeadmin-0.4.2 vs spec/unit/comments_spec.rb in activeadmin-0.4.3

- old
+ new

@@ -35,9 +35,27 @@ another_post = Post.create! :title => "Another Hello World" ActiveAdmin::Comment.find_for_resource_in_namespace(another_post, namespace_name).should == [] end end + describe ".resource_id_cast" do + let(:post) { Post.create!(:title => "Testing.") } + let(:namespace_name) { "admin" } + + it "should cast resource_id as string" do + comment = ActiveAdmin::Comment.create! :resource => post, + :body => "Another Comment", + :namespace => namespace_name + ActiveAdmin::Comment.resource_id_cast(comment).class.should eql String + end + end + + describe ".resource_id_type" do + it "should be :string" do + ActiveAdmin::Comment.resource_id_type.should eql :string + end + end + describe "Commenting on resource with string id" do let(:tag){ Tag.create!(:name => "cooltags") } let(:namespace_name){ "admin" } it "should allow commenting" do