features/comments/commenting.feature in yousty-activeadmin-1.0.4.pre vs features/comments/commenting.feature in yousty-activeadmin-1.0.5.pre
- old
+ new
@@ -37,19 +37,33 @@
Then I should not see the element "div.comments.panel"
Scenario: View a resource in a namespace that doesn't have comments
Given a configuration of:
"""
- ActiveAdmin.application.namespace(:new_namespace).allow_comments = false
+ ActiveAdmin.application.namespace(:new_namespace).comments = false
ActiveAdmin.register Post, :namespace => :new_namespace
ActiveAdmin.register AdminUser, :namespace => :new_namespace
"""
Given I am logged in
When I am on the index page for posts in the new_namespace namespace
And I follow "View"
Then I should not see "Comments"
+ Scenario: Enable comments on per-resource basis
+ Given a configuration of:
+ """
+ ActiveAdmin.application.namespace(:new_namespace).comments = false
+ ActiveAdmin.register Post, :namespace => :new_namespace do
+ config.comments = true
+ end
+ ActiveAdmin.register AdminUser, :namespace => :new_namespace
+ """
+ Given I am logged in
+ When I am on the index page for posts in the new_namespace namespace
+ And I follow "View"
+ Then I should see "Comments"
+
Scenario: Creating a comment in one namespace does not create it in another
Given a show configuration of:
"""
ActiveAdmin.register Post
ActiveAdmin.register Post, :namespace => :public
@@ -99,11 +113,11 @@
When I add a comment "Hello from Comment"
When I am on the index page for comments
Then I should see a table header with "Body"
And I should see "Hello from Comment"
- Scenario: Commenting on a STI subclass
+ Scenario: Commenting on a STI superclass
Given a configuration of:
"""
ActiveAdmin.register User
"""
Given I am logged in
@@ -111,22 +125,39 @@
When I am on the index page for users
And I follow "View"
When I add a comment "Hello World"
Then I should see a flash with "Comment was successfully created"
And I should be in the resource section for users
+ When I am on the index page for comments
+ Then I should see the content "User"
+ And I should see "Hello World"
+ Scenario: Commenting on a STI subclass
+ Given a configuration of:
+ """
+ ActiveAdmin.register Publisher
+ """
+ Given I am logged in
+ And a publisher named "Pragmatic Publishers" exists
+ When I am on the index page for publishers
+ And I follow "View"
+ When I add a comment "Hello World"
+ Then I should see a flash with "Comment was successfully created"
+ And I should be in the resource section for publishers
+ And I should see "Hello World"
+
Scenario: Commenting on a class with string id
- Given a tag with the name "coolness" exists
- Given a configuration of:
- """
- ActiveAdmin.register Tag
- """
- Given I am logged in
- When I am on the index page for tags
- And I follow "View"
- When I add a comment "Tag Comment"
- Then I should see a flash with "Comment was successfully created"
- And I should be in the resource section for tags
+ Given a tag with the name "coolness" exists
+ Given a configuration of:
+ """
+ ActiveAdmin.register Tag
+ """
+ Given I am logged in
+ When I am on the index page for tags
+ And I follow "View"
+ When I add a comment "Tag Comment"
+ Then I should see a flash with "Comment was successfully created"
+ And I should be in the resource section for tags
Scenario: Commenting on an aliased resource with an existing non-aliased config
Given a configuration of:
"""
ActiveAdmin.register Post