-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
page_title.feature
58 lines (50 loc) · 1.51 KB
/
page_title.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Feature: Show - Page Title
Modifying the page title on the show screen
Background:
Given a post with the title "Hello World" written by "Jane Doe" exists
Scenario: Set a method to be called on the resource as the title
Given a show configuration of:
"""
ActiveAdmin.register Post do
show title: :title
end
"""
Then I should see the page title "Hello World"
Scenario: Set a string as the title
Given a show configuration of:
"""
ActiveAdmin.register Post do
show title: "Title From String"
end
"""
Then I should see the page title "Title From String"
Scenario: Set a proc as the title
Given a show configuration of:
"""
ActiveAdmin.register Post do
show title: proc{|post| "Title: " + post.title }
end
"""
Then I should see the page title "Title: Hello World"
Scenario: Default title
Given a show configuration of:
"""
ActiveAdmin.register Post
"""
Then I should see the page title "Hello World"
Scenario: Default title with no display name method candidate
Given a show configuration of:
"""
ActiveAdmin.register Tag
"""
Then I should see the page title "Tag #"
Scenario: Set the title in controller
Given a show configuration of:
"""
ActiveAdmin.register Post do
controller do
before_action { @page_title = "List of #{resource_class.model_name.plural}" }
end
end
"""
Then I should see the page title "List of posts"