hammer_cli_foreman 3.6.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes.md +13 -0
  3. data/lib/hammer_cli_foreman/command_extensions/update_common.rb +1 -1
  4. data/lib/hammer_cli_foreman/commands.rb +2 -4
  5. data/lib/hammer_cli_foreman/compute_resource/utils.rb +7 -7
  6. data/lib/hammer_cli_foreman/exception_handler.rb +2 -8
  7. data/lib/hammer_cli_foreman/external_usergroup.rb +0 -2
  8. data/lib/hammer_cli_foreman/resource_supported_test.rb +1 -1
  9. data/lib/hammer_cli_foreman/testing/api_expectations.rb +2 -2
  10. data/lib/hammer_cli_foreman/version.rb +1 -1
  11. data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  12. data/locale/cs_CZ/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  13. data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  14. data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  15. data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  16. data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  17. data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  18. data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  19. data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  20. data/locale/ka/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  21. data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  22. data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  23. data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  24. data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  25. data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  26. data/test/functional/associating_commands_test.rb +2 -2
  27. data/test/functional/bookmark_test.rb +2 -2
  28. data/test/functional/commands/list_test.rb +4 -4
  29. data/test/functional/filter_test.rb +1 -1
  30. data/test/functional/location_test.rb +1 -1
  31. data/test/functional/media_test.rb +2 -2
  32. data/test/functional/report_template_test.rb +4 -4
  33. data/test/functional/settings_test.rb +1 -1
  34. data/test/functional/virtual_machine_test.rb +4 -4
  35. data/test/test_helper.rb +0 -1
  36. data/test/unit/api/interactive_basic_auth_test.rb +2 -2
  37. data/test/unit/api/oauth/oauth_authentication_code_grant_test.rb +2 -2
  38. data/test/unit/api/oauth/oauth_password_grant_test.rb +2 -2
  39. data/test/unit/api/session_authenticator_wrapper_test.rb +7 -7
  40. data/test/unit/architecture_test.rb +12 -12
  41. data/test/unit/audit_test.rb +6 -6
  42. data/test/unit/auth_source_external.rb +5 -5
  43. data/test/unit/auth_source_ldap_test.rb +12 -12
  44. data/test/unit/bookmark_test.rb +12 -12
  45. data/test/unit/commands_test.rb +9 -9
  46. data/test/unit/common_parameter_test.rb +10 -10
  47. data/test/unit/compute_profile_test.rb +12 -12
  48. data/test/unit/compute_resource_test.rb +18 -18
  49. data/test/unit/config_report_test.rb +7 -7
  50. data/test/unit/domain_test.rb +16 -16
  51. data/test/unit/exception_handler_test.rb +1 -1
  52. data/test/unit/external_usergroup_test.rb +15 -15
  53. data/test/unit/fact_test.rb +3 -3
  54. data/test/unit/filter_test.rb +18 -18
  55. data/test/unit/helpers/command.rb +33 -33
  56. data/test/unit/helpers/resource_disabled.rb +1 -1
  57. data/test/unit/host_test.rb +35 -35
  58. data/test/unit/hostgroup_test.rb +18 -18
  59. data/test/unit/id_resolver_test.rb +1 -1
  60. data/test/unit/image_test.rb +15 -15
  61. data/test/unit/location_test.rb +12 -12
  62. data/test/unit/mail_notification_test.rb +6 -6
  63. data/test/unit/media_test.rb +12 -12
  64. data/test/unit/model_test.rb +12 -12
  65. data/test/unit/operating_system_test.rb +16 -16
  66. data/test/unit/option_builders_test.rb +2 -2
  67. data/test/unit/organization_test.rb +12 -12
  68. data/test/unit/output/formatters_test.rb +4 -4
  69. data/test/unit/param_filters_test.rb +2 -2
  70. data/test/unit/partition_table_test.rb +14 -14
  71. data/test/unit/realm_test.rb +12 -12
  72. data/test/unit/role_test.rb +14 -14
  73. data/test/unit/settings_test.rb +5 -5
  74. data/test/unit/smart_proxy_test.rb +14 -14
  75. data/test/unit/subnet_test.rb +12 -12
  76. data/test/unit/template_test.rb +16 -16
  77. data/test/unit/user_test.rb +12 -12
  78. data/test/unit/usergroup_test.rb +12 -12
  79. metadata +24 -22
@@ -8,7 +8,7 @@ describe HammerCLIForeman::Role do
8
8
  include CommandTestHelper
9
9
 
10
10
 
11
- context "ListCommand" do
11
+ describe "ListCommand" do
12
12
 
13
13
  let(:cmd) { HammerCLIForeman::Role::ListCommand.new("", ctx) }
14
14
 
@@ -16,12 +16,12 @@ describe HammerCLIForeman::Role do
16
16
  ResourceMocks.mock_action_call(:roles, :index, [])
17
17
  end
18
18
 
19
- context "parameters" do
19
+ describe "parameters" do
20
20
  it_should_accept "no arguments"
21
21
  it_should_accept_search_params
22
22
  end
23
23
 
24
- context "output" do
24
+ describe "output" do
25
25
  it_should_print_column "Id"
26
26
  it_should_print_column "Name"
27
27
  end
@@ -29,11 +29,11 @@ describe HammerCLIForeman::Role do
29
29
  end
30
30
 
31
31
 
32
- context "InfoCommand" do
32
+ describe "InfoCommand" do
33
33
 
34
34
  let(:cmd) { HammerCLIForeman::Role::InfoCommand.new("", ctx) }
35
35
 
36
- context "output" do
36
+ describe "output" do
37
37
 
38
38
  with_params ["--name=role"] do
39
39
  it_should_print_n_records 1
@@ -44,11 +44,11 @@ describe HammerCLIForeman::Role do
44
44
  end
45
45
 
46
46
 
47
- context "CreateCommand" do
47
+ describe "CreateCommand" do
48
48
 
49
49
  let(:cmd) { HammerCLIForeman::Role::CreateCommand.new("", ctx) }
50
50
 
51
- context "parameters" do
51
+ describe "parameters" do
52
52
  it_should_accept "name", ["--name=role"]
53
53
  end
54
54
 
@@ -57,21 +57,21 @@ describe HammerCLIForeman::Role do
57
57
  end
58
58
  end
59
59
 
60
- context "DeleteCommand" do
60
+ describe "DeleteCommand" do
61
61
 
62
62
  let(:cmd) { HammerCLIForeman::Role::DeleteCommand.new("", ctx) }
63
63
 
64
- context "parameters" do
64
+ describe "parameters" do
65
65
  it_should_accept "name", ["--name=role"]
66
66
  it_should_accept "id", ["--id=1"]
67
67
  end
68
68
  end
69
69
 
70
- context "UpdateCommand" do
70
+ describe "UpdateCommand" do
71
71
 
72
72
  let(:cmd) { HammerCLIForeman::Role::UpdateCommand.new("", ctx) }
73
73
 
74
- context "parameters" do
74
+ describe "parameters" do
75
75
  it_should_accept "name", ["--name=role"]
76
76
  it_should_accept "id", ["--id=1"]
77
77
  it_should_accept "name and new name", ["--name=role", "--new-name=role2"]
@@ -83,7 +83,7 @@ describe HammerCLIForeman::Role do
83
83
 
84
84
  end
85
85
 
86
- context "FiltersCommand" do
86
+ describe "FiltersCommand" do
87
87
 
88
88
  let(:cmd) { HammerCLIForeman::Role::FiltersCommand.new("", ctx) }
89
89
 
@@ -91,13 +91,13 @@ describe HammerCLIForeman::Role do
91
91
  ResourceMocks.mock_action_call(:filters, :index, [])
92
92
  end
93
93
 
94
- context "parameters" do
94
+ describe "parameters" do
95
95
  it_should_accept "name", ["--name=role"]
96
96
  it_should_accept "id", ["--id=1"]
97
97
  it_should_fail_with "no arguments"
98
98
  end
99
99
 
100
- context "output" do
100
+ describe "output" do
101
101
  with_params ["--id=1"] do
102
102
  it_should_print_column "Id"
103
103
  it_should_print_column "Resource type"
@@ -7,7 +7,7 @@ describe HammerCLIForeman::Settings do
7
7
 
8
8
  include CommandTestHelper
9
9
 
10
- context "ListCommand" do
10
+ describe "ListCommand" do
11
11
 
12
12
  before do
13
13
  ResourceMocks.mock_action_call(:settings, :index, [])
@@ -15,14 +15,14 @@ describe HammerCLIForeman::Settings do
15
15
 
16
16
  let(:cmd) { HammerCLIForeman::Settings::ListCommand.new("", ctx) }
17
17
 
18
- context "parameters" do
18
+ describe "parameters" do
19
19
  it_should_accept "no arguments"
20
20
  it_should_accept_search_params
21
21
  it_should_accept 'organization', ['--organization-id=1']
22
22
  it_should_accept 'location', ['--location-id=1']
23
23
  end
24
24
 
25
- context "output" do
25
+ describe "output" do
26
26
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
27
27
 
28
28
  it_should_print_n_records
@@ -34,10 +34,10 @@ describe HammerCLIForeman::Settings do
34
34
 
35
35
  end
36
36
 
37
- context "UpdateCommand" do
37
+ describe "UpdateCommand" do
38
38
  let(:cmd) { HammerCLIForeman::Settings::UpdateCommand.new("", ctx) }
39
39
 
40
- context "parameters" do
40
+ describe "parameters" do
41
41
  it_should_accept "name", ["--name=setting1", "--value=setting2"]
42
42
  it_should_accept "id", ["--id=1", "--value=setting2"]
43
43
  it_should_accept 'organization', %w[--id=1 --organization-id=1]
@@ -7,19 +7,19 @@ describe HammerCLIForeman::SmartProxy do
7
7
 
8
8
  include CommandTestHelper
9
9
 
10
- context "ListCommand" do
10
+ describe "ListCommand" do
11
11
  before do
12
12
  ResourceMocks.mock_action_call(:smart_proxies, :index, [])
13
13
  end
14
14
 
15
15
  let(:cmd) { HammerCLIForeman::SmartProxy::ListCommand.new("", ctx) }
16
16
 
17
- context "parameters" do
17
+ describe "parameters" do
18
18
  it_should_accept "no arguments"
19
19
  it_should_accept_search_params
20
20
  end
21
21
 
22
- context "output" do
22
+ describe "output" do
23
23
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
24
24
 
25
25
  it_should_print_n_records
@@ -29,17 +29,17 @@ describe HammerCLIForeman::SmartProxy do
29
29
  end
30
30
 
31
31
 
32
- context "InfoCommand" do
32
+ describe "InfoCommand" do
33
33
 
34
34
  let(:cmd) { HammerCLIForeman::SmartProxy::InfoCommand.new("", ctx) }
35
35
 
36
- context "parameters" do
36
+ describe "parameters" do
37
37
  it_should_accept "id", ["--id=1"]
38
38
  it_should_accept "name", ["--name=proxy"]
39
39
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
40
40
  end
41
41
 
42
- context "output" do
42
+ describe "output" do
43
43
  with_params ["--id=1"] do
44
44
  it_should_print_n_records 1
45
45
  it_should_print_columns ["Id", "Name", "URL", "Features", "Created at", "Updated at"]
@@ -49,11 +49,11 @@ describe HammerCLIForeman::SmartProxy do
49
49
  end
50
50
 
51
51
 
52
- context "CreateCommand" do
52
+ describe "CreateCommand" do
53
53
 
54
54
  let(:cmd) { HammerCLIForeman::SmartProxy::CreateCommand.new("", ctx) }
55
55
 
56
- context "parameters" do
56
+ describe "parameters" do
57
57
  it_should_accept "name and url", ["--name=proxy", "--url=localhost"]
58
58
  # it_should_fail_with "name missing", ["--url=localhost"]
59
59
  # it_should_fail_with "url missing", ["--name=proxy"]
@@ -63,11 +63,11 @@ describe HammerCLIForeman::SmartProxy do
63
63
  end
64
64
 
65
65
 
66
- context "DeleteCommand" do
66
+ describe "DeleteCommand" do
67
67
 
68
68
  let(:cmd) { HammerCLIForeman::SmartProxy::DeleteCommand.new("", ctx) }
69
69
 
70
- context "parameters" do
70
+ describe "parameters" do
71
71
  it_should_accept "id", ["--id=1"]
72
72
  it_should_accept "name", ["--name=proxy"]
73
73
  # it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
@@ -76,11 +76,11 @@ describe HammerCLIForeman::SmartProxy do
76
76
  end
77
77
 
78
78
 
79
- context "UpdateCommand" do
79
+ describe "UpdateCommand" do
80
80
 
81
81
  let(:cmd) { HammerCLIForeman::SmartProxy::UpdateCommand.new("", ctx) }
82
82
 
83
- context "parameters" do
83
+ describe "parameters" do
84
84
  it_should_accept "id", ["--id=1", "--new-name=proxy2", "--url=localhost"]
85
85
  it_should_accept "name", ["--name=proxy", "--new-name=proxy2", "--url=localhost"]
86
86
  # it_should_fail_with "no params", []
@@ -90,11 +90,11 @@ describe HammerCLIForeman::SmartProxy do
90
90
 
91
91
  end
92
92
 
93
- context "RefreshFeaturesCommand" do
93
+ describe "RefreshFeaturesCommand" do
94
94
 
95
95
  let(:cmd) { HammerCLIForeman::SmartProxy::RefreshFeaturesCommand.new("", ctx) }
96
96
 
97
- context "parameters" do
97
+ describe "parameters" do
98
98
  it_should_accept "id", ["--id=1"]
99
99
  it_should_accept "name", ["--name=proxy"]
100
100
  # it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
@@ -7,19 +7,19 @@ describe HammerCLIForeman::Subnet do
7
7
 
8
8
  include CommandTestHelper
9
9
 
10
- context "ListCommand" do
10
+ describe "ListCommand" do
11
11
  before do
12
12
  ResourceMocks.mock_action_call(:subnets, :index, [])
13
13
  end
14
14
 
15
15
  let(:cmd) { HammerCLIForeman::Subnet::ListCommand.new("", ctx) }
16
16
 
17
- context "parameters" do
17
+ describe "parameters" do
18
18
  it_should_accept "no arguments"
19
19
  it_should_accept_search_params
20
20
  end
21
21
 
22
- context "output" do
22
+ describe "output" do
23
23
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
24
24
 
25
25
  it_should_print_n_records
@@ -30,17 +30,17 @@ describe HammerCLIForeman::Subnet do
30
30
  end
31
31
 
32
32
 
33
- context "InfoCommand" do
33
+ describe "InfoCommand" do
34
34
 
35
35
  let(:cmd) { HammerCLIForeman::Subnet::InfoCommand.new("", ctx) }
36
36
 
37
- context "parameters" do
37
+ describe "parameters" do
38
38
  it_should_accept "id", ["--id=1"]
39
39
  it_should_accept "name", ["--name=arch"]
40
40
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
41
41
  end
42
42
 
43
- context "output" do
43
+ describe "output" do
44
44
 
45
45
  with_params ["--name=subnet"] do
46
46
  it_should_print_n_records 1
@@ -58,11 +58,11 @@ describe HammerCLIForeman::Subnet do
58
58
  end
59
59
 
60
60
 
61
- context "CreateCommand" do
61
+ describe "CreateCommand" do
62
62
 
63
63
  let(:cmd) { HammerCLIForeman::Subnet::CreateCommand.new("", ctx) }
64
64
 
65
- context "parameters" do
65
+ describe "parameters" do
66
66
  it_should_accept "name", ["--name=arch", "--network=192.168.83.0", "--mask=255.255.255.0"]
67
67
  # it_should_fail_with "name missing", ["--network=192.168.83.0", "--mask=255.255.255.0"]
68
68
  # it_should_fail_with "network missing", ["--name=arch", "--mask=255.255.255.0"]
@@ -73,11 +73,11 @@ describe HammerCLIForeman::Subnet do
73
73
  end
74
74
 
75
75
 
76
- context "DeleteCommand" do
76
+ describe "DeleteCommand" do
77
77
 
78
78
  let(:cmd) { HammerCLIForeman::Subnet::DeleteCommand.new("", ctx) }
79
79
 
80
- context "parameters" do
80
+ describe "parameters" do
81
81
  it_should_accept "name", ["--name=arch"]
82
82
  it_should_accept "id", ["--id=1"]
83
83
  # it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
@@ -86,11 +86,11 @@ describe HammerCLIForeman::Subnet do
86
86
  end
87
87
 
88
88
 
89
- context "UpdateCommand" do
89
+ describe "UpdateCommand" do
90
90
 
91
91
  let(:cmd) { HammerCLIForeman::Subnet::UpdateCommand.new("", ctx) }
92
92
 
93
- context "parameters" do
93
+ describe "parameters" do
94
94
  it_should_accept "name", ["--name=arch", "--new-name=arch2"]
95
95
  it_should_accept "id", ["--id=1", "--new-name=arch2"]
96
96
  # it_should_fail_with "no params", []
@@ -20,19 +20,19 @@ describe HammerCLIForeman::Template do
20
20
  File.stubs(:read).returns("")
21
21
  end
22
22
 
23
- context "ListCommand" do
23
+ describe "ListCommand" do
24
24
  before do
25
25
  ResourceMocks.mock_action_call(:provisioning_templates, :index, [])
26
26
  end
27
27
 
28
28
  let(:cmd) { HammerCLIForeman::Template::ListCommand.new("", ctx) }
29
29
 
30
- context "parameters" do
30
+ describe "parameters" do
31
31
  it_should_accept "no arguments"
32
32
  it_should_accept_search_params
33
33
  end
34
34
 
35
- context "output" do
35
+ describe "output" do
36
36
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
37
37
 
38
38
  it_should_print_n_records
@@ -52,11 +52,11 @@ describe HammerCLIForeman::Template do
52
52
  end
53
53
 
54
54
 
55
- context "InfoCommand" do
55
+ describe "InfoCommand" do
56
56
 
57
57
  let(:cmd) { HammerCLIForeman::Template::InfoCommand.new("", ctx) }
58
58
 
59
- context "parameters" do
59
+ describe "parameters" do
60
60
  before(:each) do
61
61
  template = {
62
62
  'config_template' => {
@@ -71,7 +71,7 @@ describe HammerCLIForeman::Template do
71
71
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
72
72
  end
73
73
 
74
- context "output" do
74
+ describe "output" do
75
75
  with_params ["--id=1"] do
76
76
  before(:each) do
77
77
  template = {
@@ -91,25 +91,25 @@ describe HammerCLIForeman::Template do
91
91
  end
92
92
 
93
93
 
94
- context "ListKindsCommand" do
94
+ describe "ListKindsCommand" do
95
95
  before do
96
96
  ResourceMocks.mock_action_call(:template_kinds, :index, [])
97
97
  end
98
98
 
99
99
  let(:cmd) { HammerCLIForeman::Template::ListKindsCommand.new("", ctx) }
100
100
 
101
- context "parameters" do
101
+ describe "parameters" do
102
102
  it_should_accept "no arguments"
103
103
  end
104
104
 
105
105
  end
106
106
 
107
107
 
108
- context "DumpCommand" do
108
+ describe "DumpCommand" do
109
109
 
110
110
  let(:cmd) { HammerCLIForeman::Template::DumpCommand.new("", ctx) }
111
111
 
112
- context "parameters" do
112
+ describe "parameters" do
113
113
  it_should_accept "id", ["--id=1"]
114
114
  # it_should_fail_with "no params", [] # TODO: temporarily disabled, parameters are checked in the id resolver
115
115
  end
@@ -117,7 +117,7 @@ describe HammerCLIForeman::Template do
117
117
  end
118
118
 
119
119
 
120
- context "CreateCommand" do
120
+ describe "CreateCommand" do
121
121
 
122
122
  let(:cmd) { HammerCLIForeman::Template::CreateCommand.new("", ctx) }
123
123
 
@@ -125,7 +125,7 @@ describe HammerCLIForeman::Template do
125
125
  cmd.stubs(:option_template_kind_id).returns(1)
126
126
  end
127
127
 
128
- context "parameters" do
128
+ describe "parameters" do
129
129
  it_should_accept "name, file, type, audit comment, os ids", ["--name=tpl", "--file=~/tpl.sh", "--type=snippet", "--audit-comment=fix", "--operatingsystem-ids=1,2,3"]
130
130
  # it_should_fail_with "name missing", ["--file=~/tpl.sh", "--type=snippet", "--audit-comment=fix", "--operatingsystem-ids=1,2,3"]
131
131
  # it_should_fail_with "type missing", ["--name=tpl", "--file=~/tpl.sh", "--audit-comment=fix", "--operatingsystem-ids=1,2,3"]
@@ -136,7 +136,7 @@ describe HammerCLIForeman::Template do
136
136
  end
137
137
 
138
138
 
139
- context "UpdateCommand" do
139
+ describe "UpdateCommand" do
140
140
 
141
141
  let(:cmd) { HammerCLIForeman::Template::UpdateCommand.new("", ctx) }
142
142
 
@@ -144,7 +144,7 @@ describe HammerCLIForeman::Template do
144
144
  cmd.stubs(:option_template_kind_id).returns(1)
145
145
  end
146
146
 
147
- context "parameters" do
147
+ describe "parameters" do
148
148
  it_should_accept "id, name, file, type, audit comment, os ids", ["--id=83", "--name=tpl", "--file=~/tpl.sh", "--type=snippet", "--audit-comment=fix", "--operatingsystem-ids=1,2,3"]
149
149
  # it_should_fail_with "id missing", ["--name=tpl", "--file=~/tpl.sh", "--type=snippet", "--audit-comment=fix", "--operatingsystem-ids=1,2,3"]
150
150
  # TODO: temporarily disabled, parameters are checked in the id resolver
@@ -153,11 +153,11 @@ describe HammerCLIForeman::Template do
153
153
  end
154
154
 
155
155
 
156
- context "DeleteCommand" do
156
+ describe "DeleteCommand" do
157
157
 
158
158
  let(:cmd) { HammerCLIForeman::Template::DeleteCommand.new("", ctx) }
159
159
 
160
- context "parameters" do
160
+ describe "parameters" do
161
161
  it_should_accept "id", ["--id=1"]
162
162
  # it_should_fail_with "no params", [] # TODO: temporarily disabled, parameters are checked in the id resolver
163
163
  end
@@ -9,19 +9,19 @@ describe HammerCLIForeman::User do
9
9
 
10
10
  let(:cmd_module) { HammerCLIForeman::User }
11
11
 
12
- context "ListCommand" do
12
+ describe "ListCommand" do
13
13
  before do
14
14
  ResourceMocks.mock_action_call(:users, :index, [])
15
15
  end
16
16
 
17
17
  let(:cmd) { cmd_module::ListCommand.new("", ctx ) }
18
18
 
19
- context "parameters" do
19
+ describe "parameters" do
20
20
  it_should_accept "no arguments"
21
21
  it_should_accept_search_params
22
22
  end
23
23
 
24
- context "output" do
24
+ describe "output" do
25
25
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
26
26
  it_should_print_n_records
27
27
  it_should_print_columns ["Id", "Login", "Name", "Email", "Admin", "Last login", "Authorized by"]
@@ -30,20 +30,20 @@ describe HammerCLIForeman::User do
30
30
  end
31
31
 
32
32
 
33
- context "InfoCommand" do
33
+ describe "InfoCommand" do
34
34
  before do
35
35
  ResourceMocks.users_show
36
36
  end
37
37
 
38
38
  let(:cmd) { cmd_module::InfoCommand.new("", ctx) }
39
39
 
40
- context "parameters" do
40
+ describe "parameters" do
41
41
  it_should_accept "id", ["--id=1"]
42
42
  it_should_accept "login", ["--login=admin"]
43
43
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
44
44
  end
45
45
 
46
- context "output" do
46
+ describe "output" do
47
47
  with_params ["--id=1"] do
48
48
  it_should_print_n_records 1
49
49
  it_should_print_columns ["Id", "Login", "Name", "Email", "Admin", "Effective admin"]
@@ -54,11 +54,11 @@ describe HammerCLIForeman::User do
54
54
  end
55
55
 
56
56
 
57
- context "CreateCommand" do
57
+ describe "CreateCommand" do
58
58
 
59
59
  let(:cmd) { cmd_module::CreateCommand.new("", ctx) }
60
60
 
61
- context "parameters" do
61
+ describe "parameters" do
62
62
  it_should_accept "all required", ["--login=login", "--mail=mail", "--password=paswd", "--auth-source-id=1"]
63
63
  it_should_accept "all required plus names", ["--login=login", "--firstname=fname", "--lastname=lname", "--mail=mail", "--password=paswd", "--auth-source-id=1"]
64
64
  # it_should_fail_with "login missing", ["--firstname=fname", "--lastname=lname", "--mail=mail", "--password=paswd", "--auth-source-id=1"]
@@ -71,11 +71,11 @@ describe HammerCLIForeman::User do
71
71
  end
72
72
 
73
73
 
74
- context "DeleteCommand" do
74
+ describe "DeleteCommand" do
75
75
 
76
76
  let(:cmd) { cmd_module::DeleteCommand.new("", ctx) }
77
77
 
78
- context "parameters" do
78
+ describe "parameters" do
79
79
  it_should_accept "id", ["--id=1"]
80
80
  it_should_accept "login", ["--login=admin"]
81
81
  # it_should_fail_with "id and login missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
@@ -84,7 +84,7 @@ describe HammerCLIForeman::User do
84
84
  end
85
85
 
86
86
 
87
- context "UpdateCommand" do
87
+ describe "UpdateCommand" do
88
88
 
89
89
  let(:cmd) { cmd_module::UpdateCommand.new("", ctx) }
90
90
 
@@ -92,7 +92,7 @@ describe HammerCLIForeman::User do
92
92
  HammerCLIForeman::OptionSources::UserParams.any_instance.stubs(:ask_password).returns("password")
93
93
  end
94
94
 
95
- context "parameters" do
95
+ describe "parameters" do
96
96
  it_should_accept "password and current password interactively", ["--login=jane", "--ask-password=true"]
97
97
  it_should_accept "id", ["--id=1"]
98
98
  it_should_accept "login", ["--login=admin"]
@@ -8,21 +8,21 @@ describe HammerCLIForeman::Usergroup do
8
8
  include CommandTestHelper
9
9
 
10
10
 
11
- context "ListCommand" do
11
+ describe "ListCommand" do
12
12
  before do
13
13
  ResourceMocks.mock_action_call(:usergroups, :index, [])
14
14
  end
15
15
 
16
16
  let(:cmd) { HammerCLIForeman::Usergroup::ListCommand.new("", ctx) }
17
17
 
18
- context "parameters" do
18
+ describe "parameters" do
19
19
  it_should_accept "no arguments"
20
20
  it_should_accept_search_params
21
21
  it_should_accept 'organization', ['--organization-id=1']
22
22
  it_should_accept 'location', ['--location-id=1']
23
23
  end
24
24
 
25
- context "output" do
25
+ describe "output" do
26
26
  it_should_print_column "Id"
27
27
  it_should_print_column "Name"
28
28
  it_should_print_column "Admin"
@@ -30,18 +30,18 @@ describe HammerCLIForeman::Usergroup do
30
30
 
31
31
  end
32
32
 
33
- context "InfoCommand" do
33
+ describe "InfoCommand" do
34
34
 
35
35
  let(:cmd) { HammerCLIForeman::Usergroup::InfoCommand.new("", ctx) }
36
36
 
37
- context "parameters" do
37
+ describe "parameters" do
38
38
  it_should_accept "id", ["--id=1"]
39
39
  it_should_accept "name", ["--name=ug"]
40
40
  it_should_accept 'organization', %w[--id=1 --organization-id=1]
41
41
  it_should_accept 'location', %w[--id=1 --location-id=1]
42
42
  end
43
43
 
44
- context "output" do
44
+ describe "output" do
45
45
  with_params ["--id=1"] do
46
46
  it_should_print_column "Id"
47
47
  it_should_print_column "Name"
@@ -55,11 +55,11 @@ describe HammerCLIForeman::Usergroup do
55
55
  end
56
56
  end
57
57
 
58
- context "CreateCommand" do
58
+ describe "CreateCommand" do
59
59
 
60
60
  let(:cmd) { HammerCLIForeman::Usergroup::CreateCommand.new("", ctx) }
61
61
 
62
- context "parameters" do
62
+ describe "parameters" do
63
63
  it_should_accept "name", ["--name=ug"]
64
64
  it_should_accept "name, role ids, user group ids and user ids", ["--name=ug", "--role-ids=1,2,3", "--user-group-ids=1,2,3", "--user-ids=1,2,3"]
65
65
  it_should_accept 'organization', %w[--name=ug --organization-id=1]
@@ -67,11 +67,11 @@ describe HammerCLIForeman::Usergroup do
67
67
  end
68
68
  end
69
69
 
70
- context "DeleteCommand" do
70
+ describe "DeleteCommand" do
71
71
 
72
72
  let(:cmd) { HammerCLIForeman::Usergroup::DeleteCommand.new("", ctx) }
73
73
 
74
- context "parameters" do
74
+ describe "parameters" do
75
75
  it_should_accept "name", ["--name=ug"]
76
76
  it_should_accept "id", ["--id=1"]
77
77
  it_should_accept 'organization', %w[--id=1 --organization-id=1]
@@ -79,11 +79,11 @@ describe HammerCLIForeman::Usergroup do
79
79
  end
80
80
  end
81
81
 
82
- context "UpdateCommand" do
82
+ describe "UpdateCommand" do
83
83
 
84
84
  let(:cmd) { HammerCLIForeman::Usergroup::UpdateCommand.new("", ctx) }
85
85
 
86
- context "parameters" do
86
+ describe "parameters" do
87
87
  it_should_accept "name", ["--name=ug"]
88
88
  it_should_accept "id", ["--id=1"]
89
89
  it_should_accept "name and new name", ["--name=ug", "--new-name=ug2"]