features/index/formats.feature in activeadmin-1.0.0.pre5 vs features/index/formats.feature in activeadmin-1.0.0
- old
+ new
@@ -49,10 +49,19 @@
When I am on the index page for posts
Then I should not see a link to download "CSV"
And I should not see a link to download "XML"
And I should not see a link to download "JSON"
+ When I go to the csv index page for posts
+ Then access denied
+
+ When I go to the xml index page for posts
+ Then access denied
+
+ When I go to the json index page for posts
+ Then access denied
+
Scenario: View index with download_links block which returns [:csv]
Given an index configuration of:
"""
ActiveAdmin.register Post do
index download_links: -> { [:csv] }
@@ -62,5 +71,18 @@
When I am on the index page for posts
Then I should see a link to download "CSV"
And I should not see a link to download "XML"
And I should not see a link to download "JSON"
And I should not see a link to download "PDF"
+
+ Scenario: View index with restricted formats
+ Given an index configuration of:
+ """
+ ActiveAdmin.register Post do
+ index download_links: -> { [:json] }
+ end
+ """
+ When I go to the csv index page for posts
+ Then access denied
+
+ When I go to the xml index page for posts
+ Then access denied
\ No newline at end of file