spec/unit/comments_spec.rb in activeadmin-1.0.0.pre5 vs spec/unit/comments_spec.rb in activeadmin-1.0.0

- old
+ new

@@ -38,11 +38,10 @@ another_post = Post.create! title: "Another Hello World" expect(ActiveAdmin::Comment.find_for_resource_in_namespace(another_post, namespace_name)).to eq [] end it "should return the most recent comment first by default" do - ActiveAdmin::Comment.class_eval { attr_accessible :created_at } if Rails::VERSION::MAJOR == 3 another_comment = ActiveAdmin::Comment.create! resource: post, body: "Another Comment", namespace: namespace_name, created_at: @comment.created_at + 20.minutes @@ -84,22 +83,10 @@ expect(comments.last).to eq(@comment) end 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 - expect(ActiveAdmin::Comment.resource_id_cast(comment).class).to eql String - end - end - describe ".resource_type" do let(:post) { Post.create!(title: "Testing.") } let(:post_decorator) { double 'PostDecorator' } before do @@ -119,15 +106,9 @@ let(:resource) { post } it "returns object class string" do expect(ActiveAdmin::Comment.resource_type resource).to eql 'Post' end - end - end - - describe ".resource_id_type" do - it "should be :string" do - expect(ActiveAdmin::Comment.resource_id_type).to eql :string end end describe "Commenting on resource with string id" do let(:tag) { Tag.create!(name: "cooltags") }