forked from activeadmin/activeadmin
/
sti_resource.feature
61 lines (51 loc) · 1.97 KB
/
sti_resource.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
59
60
61
Feature: STI Resource
Ensure that standard CRUD works with STI models
Background:
Given I am logged in
And a configuration of:
"""
ActiveAdmin.register Publisher
ActiveAdmin.register User
"""
Scenario: Create, update and delete a child STI resource
Given I am on the index page for publishers
When I follow "New Publisher"
And I fill in "First name" with "Terry"
And I fill in "Last name" with "Fox"
And I fill in "Username" with "terry_fox"
And I press "Create Publisher"
Then I should see "Publisher was successfully created"
And I should see "Terry"
When I follow "Edit Publisher"
And I fill in "First name" with "Joe"
And I press "Update Publisher"
Then I should see "Publisher was successfully updated"
And I should see "Joe"
When I follow "Delete Publisher"
Then I should see "Publisher was successfully destroyed"
Scenario: Create, update and delete a parent STI resource
Given I am on the index page for users
When I follow "New User"
And I fill in "First name" with "Terry"
And I fill in "Last name" with "Fox"
And I fill in "Username" with "terry_fox"
And I press "Create User"
Then I should see "User was successfully created"
And I should see "Terry"
When I follow "Edit User"
And I fill in "First name" with "Joe"
And I press "Update User"
Then I should see "User was successfully updated"
And I should see "Joe"
When I follow "Delete User"
Then I should see "User was successfully destroyed"
Scenario: Update and delete a child STI when the parent is registered
Given a publisher named "Terry Fox" exists
And I am on the index page for users
When I follow "Edit"
And I fill in "First name" with "Joe"
And I press "Update Publisher"
Then I should see "Publisher was successfully updated"
And I should see "Joe"
When I follow "Delete User"
Then I should see "Publisher was successfully destroyed"