-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathagent_edit_default_values.rb
78 lines (56 loc) · 2.32 KB
/
agent_edit_default_values.rb
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# frozen_string_literal: true
Given 'the user is on the Agents page' do
visit "#{STAFF_URL}/agents"
end
Given 'an Agent Person has been created' do
visit "#{STAFF_URL}/agents/agent_person/new"
fill_in 'Primary Part of Name', with: "Agent #{@uuid}", match: :first
click_on 'Save'
expect(find('.alert.alert-success.with-hide-alert').text).to eq 'Agent Created'
url_parts = current_url.split('agents/agent_person').pop.split('/')
url_parts.pop
@agent_id = url_parts.pop
end
Given 'an Agent Family has been created' do
visit "#{STAFF_URL}/agents/agent_family/new"
fill_in 'Family Name', with: "Agent #{@uuid}"
click_on 'Save'
expect(find('.alert.alert-success.with-hide-alert').text).to eq 'Agent Created'
url_parts = current_url.split('agents/agent_person').pop.split('/')
url_parts.pop
@agent_id = url_parts.pop
end
Given 'an Agent Corporate Entity has been created' do
visit "#{STAFF_URL}/agents/agent_corporate_entity/new"
fill_in 'Primary Part of Name', with: "Agent #{@uuid}", match: :first
click_on 'Save'
expect(find('.alert.alert-success.with-hide-alert').text).to eq 'Agent Created'
url_parts = current_url.split('agents/agent_person').pop.split('/')
url_parts.pop
@agent_id = url_parts.pop
end
Given 'an Agent Software has been created' do
visit "#{STAFF_URL}/agents/agent_software/new"
fill_in 'Software Name', with: "Agent #{@uuid}"
click_on 'Save'
expect(find('.alert.alert-success.with-hide-alert').text).to eq 'Agent Created'
url_parts = current_url.split('agents/agent_person').pop.split('/')
url_parts.pop
@agent_id = url_parts.pop
end
Then 'the new Agent Person form has the following default values' do |form_values_table|
visit "#{STAFF_URL}/agents/agent_person/new"
expect_form_values(form_values_table)
end
Then 'the new Agent Family form has the following default values' do |form_values_table|
visit "#{STAFF_URL}/agents/agent_family/new"
expect_form_values(form_values_table)
end
Then 'the new Agent Corporate Entity form has the following default values' do |form_values_table|
visit "#{STAFF_URL}/agents/agent_corporate_entity/new"
expect_form_values(form_values_table)
end
Then 'the new Agent Software form has the following default values' do |form_values_table|
visit "#{STAFF_URL}/agents/agent_software/new"
expect_form_values(form_values_table)
end