foreman_scc_manager 1.6.3 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/Rakefile +1 -1
- data/app/controllers/api/v2/scc_accounts_controller.rb +159 -0
- data/app/controllers/api/v2/scc_products_controller.rb +64 -0
- data/app/models/scc_account.rb +2 -1
- data/app/models/scc_product.rb +1 -0
- data/app/views/api/v2/scc_accounts/base.json.rabl +5 -0
- data/app/views/api/v2/scc_accounts/index.json.rabl +4 -0
- data/app/views/api/v2/scc_accounts/main.json.rabl +5 -0
- data/app/views/api/v2/scc_accounts/show.json.rabl +4 -0
- data/app/views/api/v2/scc_products/base.json.rabl +5 -0
- data/app/views/api/v2/scc_products/index.json.rabl +4 -0
- data/app/views/api/v2/scc_products/main.json.rabl +5 -0
- data/app/views/api/v2/scc_products/show.json.rabl +5 -0
- data/config/routes.rb +30 -1
- data/lib/foreman_scc_manager/engine.rb +28 -9
- data/lib/foreman_scc_manager/version.rb +1 -1
- data/lib/tasks/rubocop.rake +0 -1
- data/locale/action_names.rb +5 -61
- data/locale/de/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/de/foreman_scc_manager.po +139 -210
- data/locale/en/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/en/foreman_scc_manager.po +129 -152
- data/locale/foreman_scc_manager.pot +120 -212
- data/test/controllers/api/v2/scc_accounts_test.rb +302 -0
- data/test/controllers/api/v2/scc_products_test.rb +40 -0
- data/test/features/sync_test.rb +3 -6
- data/test/{features → fixtures/files}/data_products_page1.json +0 -0
- data/test/{features → fixtures/files}/data_products_page2.json +0 -0
- data/test/fixtures/files/data_repositories.json +502 -0
- data/test/{features → fixtures/files}/data_subscriptions.json +0 -0
- data/test/models/scc_account_test.rb +4 -4
- data/test/models/scc_product_test.rb +2 -2
- data/test/test_plugin_helper.rb +2 -0
- metadata +25 -10
File without changes
|
@@ -7,14 +7,14 @@ class SccAccountCreateTest < ActiveSupport::TestCase
|
|
7
7
|
|
8
8
|
test 'create' do
|
9
9
|
assert @account.save
|
10
|
-
|
10
|
+
assert_not_empty SccAccount.where(:id => @account.id)
|
11
11
|
end
|
12
12
|
|
13
13
|
test 'create default url' do
|
14
14
|
account = scc_accounts(:account_missing_url)
|
15
15
|
assert account.save
|
16
16
|
assert_equal account.base_url, 'https://scc.suse.com'
|
17
|
-
|
17
|
+
assert_not_empty SccAccount.where(:id => @account.id)
|
18
18
|
end
|
19
19
|
|
20
20
|
test 'create missing value' do
|
@@ -51,7 +51,7 @@ class SccAccountCreateTest < ActiveSupport::TestCase
|
|
51
51
|
assert @account.save
|
52
52
|
end
|
53
53
|
assert_equal @account.password, '123456'
|
54
|
-
|
54
|
+
assert_not_equal @account.password_in_db, '123456'
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -64,7 +64,7 @@ class SccAccountSearchTest < ActiveSupport::TestCase
|
|
64
64
|
one = scc_accounts(:one)
|
65
65
|
accounts = SccAccount.search_for("login = \"#{one.login}\"")
|
66
66
|
assert_includes accounts, one
|
67
|
-
|
67
|
+
assert_not_includes accounts, scc_accounts(:two)
|
68
68
|
|
69
69
|
empty = SccAccount.search_for('login = "nobody"')
|
70
70
|
assert_empty empty
|
@@ -7,7 +7,7 @@ class SccProductCreateTest < ActiveSupport::TestCase
|
|
7
7
|
|
8
8
|
test 'create' do
|
9
9
|
assert @product.save
|
10
|
-
|
10
|
+
assert_not_empty SccProduct.where(id: @product.id)
|
11
11
|
end
|
12
12
|
|
13
13
|
test 'uniq_name' do
|
@@ -24,7 +24,7 @@ class SccProductSearchTest < ActiveSupport::TestCase
|
|
24
24
|
one = scc_products(:one)
|
25
25
|
products = SccProduct.search_for("name = \"#{one.name}\"")
|
26
26
|
assert_includes products, one
|
27
|
-
|
27
|
+
assert_not_includes products, scc_products(:two)
|
28
28
|
|
29
29
|
empty = SccProduct.search_for('name = "nothing"')
|
30
30
|
assert_empty empty
|
data/test/test_plugin_helper.rb
CHANGED
@@ -21,6 +21,7 @@ module FixtureTestCase
|
|
21
21
|
FileUtils.rm_rf(self.fixture_path) if File.directory?(self.fixture_path)
|
22
22
|
Dir.mkdir(self.fixture_path)
|
23
23
|
FileUtils.cp(Dir.glob("#{ForemanSccManager::Engine.root}/test/fixtures/models/*"), self.fixture_path)
|
24
|
+
FileUtils.cp(Dir.glob("#{ForemanSccManager::Engine.root}/test/fixtures/files/*"), self.fixture_path)
|
24
25
|
FileUtils.cp(Dir.glob("#{Rails.root}/test/fixtures/*"), self.fixture_path)
|
25
26
|
fixtures(:all)
|
26
27
|
FIXTURES = load_fixtures(ActiveRecord::Base)
|
@@ -33,6 +34,7 @@ end
|
|
33
34
|
|
34
35
|
class ActiveSupport::TestCase
|
35
36
|
include FactoryBot::Syntax::Methods
|
37
|
+
include ActionDispatch::TestProcess
|
36
38
|
include FixtureTestCase
|
37
39
|
include ForemanTasks::TestHelpers::WithInThreadExecutor
|
38
40
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_scc_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -92,6 +92,8 @@ files:
|
|
92
92
|
- README.md
|
93
93
|
- Rakefile
|
94
94
|
- app/assets/javascripts/foreman_scc_manager/scc_accounts.js.coffee
|
95
|
+
- app/controllers/api/v2/scc_accounts_controller.rb
|
96
|
+
- app/controllers/api/v2/scc_products_controller.rb
|
95
97
|
- app/controllers/scc_accounts_controller.rb
|
96
98
|
- app/controllers/scc_products_controller.rb
|
97
99
|
- app/helpers/scc_accounts_helper.rb
|
@@ -108,6 +110,14 @@ files:
|
|
108
110
|
- app/models/scc_extending.rb
|
109
111
|
- app/models/scc_product.rb
|
110
112
|
- app/models/scc_repository.rb
|
113
|
+
- app/views/api/v2/scc_accounts/base.json.rabl
|
114
|
+
- app/views/api/v2/scc_accounts/index.json.rabl
|
115
|
+
- app/views/api/v2/scc_accounts/main.json.rabl
|
116
|
+
- app/views/api/v2/scc_accounts/show.json.rabl
|
117
|
+
- app/views/api/v2/scc_products/base.json.rabl
|
118
|
+
- app/views/api/v2/scc_products/index.json.rabl
|
119
|
+
- app/views/api/v2/scc_products/main.json.rabl
|
120
|
+
- app/views/api/v2/scc_products/show.json.rabl
|
111
121
|
- app/views/scc_account_sync_plan_task_groups/_scc_account_sync_plan_task_groups.html.erb
|
112
122
|
- app/views/scc_accounts/_form.html.erb
|
113
123
|
- app/views/scc_accounts/edit.html.erb
|
@@ -142,11 +152,14 @@ files:
|
|
142
152
|
- locale/en/foreman_scc_manager.po
|
143
153
|
- locale/foreman_scc_manager.pot
|
144
154
|
- locale/gemspec.rb
|
155
|
+
- test/controllers/api/v2/scc_accounts_test.rb
|
156
|
+
- test/controllers/api/v2/scc_products_test.rb
|
145
157
|
- test/factories/foreman_scc_manager_factories.rb
|
146
|
-
- test/features/data_products_page1.json
|
147
|
-
- test/features/data_products_page2.json
|
148
|
-
- test/features/data_subscriptions.json
|
149
158
|
- test/features/sync_test.rb
|
159
|
+
- test/fixtures/files/data_products_page1.json
|
160
|
+
- test/fixtures/files/data_products_page2.json
|
161
|
+
- test/fixtures/files/data_repositories.json
|
162
|
+
- test/fixtures/files/data_subscriptions.json
|
150
163
|
- test/fixtures/models/scc_accounts.yml
|
151
164
|
- test/fixtures/models/scc_products.yml
|
152
165
|
- test/models/scc_account_test.rb
|
@@ -173,20 +186,22 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
186
|
- !ruby/object:Gem::Version
|
174
187
|
version: '0'
|
175
188
|
requirements: []
|
176
|
-
|
177
|
-
rubygems_version: 2.7.6
|
189
|
+
rubygems_version: 3.0.6
|
178
190
|
signing_key:
|
179
191
|
specification_version: 4
|
180
192
|
summary: Suse Customer Center plugin for Foreman
|
181
193
|
test_files:
|
194
|
+
- test/controllers/api/v2/scc_accounts_test.rb
|
195
|
+
- test/controllers/api/v2/scc_products_test.rb
|
182
196
|
- test/test_plugin_helper.rb
|
183
|
-
- test/features/data_subscriptions.json
|
184
|
-
- test/features/data_products_page1.json
|
185
197
|
- test/features/sync_test.rb
|
186
|
-
- test/features/data_products_page2.json
|
187
198
|
- test/support/fixtures_support.rb
|
188
199
|
- test/fixtures/models/scc_products.yml
|
189
200
|
- test/fixtures/models/scc_accounts.yml
|
201
|
+
- test/fixtures/files/data_subscriptions.json
|
202
|
+
- test/fixtures/files/data_products_page1.json
|
203
|
+
- test/fixtures/files/data_repositories.json
|
204
|
+
- test/fixtures/files/data_products_page2.json
|
190
205
|
- test/models/scc_product_test.rb
|
191
206
|
- test/models/scc_account_test.rb
|
192
207
|
- test/unit/foreman_scc_manager_test.rb
|