forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_another.feature
55 lines (50 loc) · 1.86 KB
/
create_another.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
Feature: Create Another checkbox
Background:
Given I am logged in
Scenario: On a new page
Given a configuration of:
"""
ActiveAdmin.register Post do
config.create_another = true
permit_params :custom_category_id, :author_id, :title,
:body, :position, :published_date, :starred
end
"""
Then I am on the index page for posts
And I follow "New Post"
When I fill in "Title" with "Hello World"
And I fill in "Body" with "This is the body"
And the "Create another Post" checkbox should not be checked
And I check "Create another"
And I press "Create Post"
Then I should see "Post was successfully created."
And I should see "New Post"
And the "Create another" checkbox should be checked
When I fill in "Title" with "Another Hello World"
And I fill in "Body" with "This is the another body"
And I uncheck "Create another"
And I press "Create Post"
Then I should see "Post was successfully created."
And I should see the attribute "Title" with "Another Hello World"
And I should see the attribute "Body" with "This is the another body"
Scenario: Application config of false and a resource config of true
Given a configuration of:
"""
ActiveAdmin.application.create_another = false
ActiveAdmin.register Post do
config.create_another = true
end
"""
When I am on the new post page
Then I should see the element ".create_another"
Then the "Create another Post" checkbox should not be checked
Scenario: Application config of true and a resource config of false
Given a configuration of:
"""
ActiveAdmin.application.create_another = true
ActiveAdmin.register Post do
config.create_another = false
end
"""
When I am on the new post page
Then I should not see the element ".create_another"