/
default_content.feature
43 lines (36 loc) · 1.44 KB
/
default_content.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Feature: Show - Default Content
Viewing the show page for a resource
Background:
Given a post with the title "Hello World" written by "Jane Doe" exists
Scenario: Viewing the default show page
Given a show configuration of:
"""
ActiveAdmin.register Post
"""
Then I should see the attribute "Title" with "Hello World"
And I should see the attribute "Body" with "Empty"
And I should see the attribute "Created At" with a nicely formatted datetime
And I should see the attribute "Author" with "Jane Doe"
And I should see an action item button "Delete Post"
And I should see an action item button "Edit Post"
Scenario: Attributes should link when linked resource is registered
Given a show configuration of:
"""
ActiveAdmin.register Post
ActiveAdmin.register User
"""
Then I should see the attribute "Author" with "Jane Doe"
And I should see a link to "Jane Doe"
Scenario: Customizing the attributes table with a set of attributes
Given a show configuration of:
"""
ActiveAdmin.register Post do
show do
attributes_table :title, :body, :created_at, :updated_at
end
end
"""
Then I should see the attribute "Title" with "Hello World"
And I should see the attribute "Body" with "Empty"
And I should see the attribute "Created At" with a nicely formatted datetime
And I should not see the attribute "Author"