foreman_remote_execution 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66bde99bb7667a338eddcafc4ace45a5a033b8bd
4
- data.tar.gz: d55a2a2d6789076c01948424f8a9548e7ed1d2de
3
+ metadata.gz: f8d8e0e19bc92e9e21f80c8a6e3e92be602746bf
4
+ data.tar.gz: 0b1fec43cafcb5cf997572113a54b581f715e465
5
5
  SHA512:
6
- metadata.gz: b99fca6b8d6d9f576cc42414f6c37e91b2121887cf696692d2beec4264ac776c4d2f16c983366c914917023724ce2e8548b1ef6caeef7b7883f10380f8bba344
7
- data.tar.gz: 85dd26a1fbbc873a0a0493672922d73067d5d73cf33d610115357a3abd59570776bb6cc06ea38b32986f08b64c914db146a61561c81718e5c1b056989dc1342c
6
+ metadata.gz: b10f8a9378e50fb25140a93a37141791f5080ee4f92027a005b1e68b8561fbc756d8780b90240f4bddd0cd50b38927f7ed849c94155ae59a3812341b0045dc2d
7
+ data.tar.gz: f0e678cf3bd185d40de34820c4d1e35cefc0d7429daedfff0d2440cb7744b49f97925259d74e1cf3743cb02492e7eedc916ca0e96d56543ae9d5055cf6d53f35
@@ -8,6 +8,7 @@ class JobTemplate < ::Template
8
8
 
9
9
  audited :allow_mass_assignment => true
10
10
  has_many :audits, :as => :auditable, :class_name => Audited.audit_class.name
11
+ has_many :template_invocations, :dependent => :destroy, :foreign_key => 'template_id'
11
12
 
12
13
  # these can't be shared in parent class, scoped search can't handle STI properly
13
14
  # tested with scoped_search 3.2.0
@@ -1,4 +1,4 @@
1
- <%= include_javascript %>
1
+ <%= include_javascript if SETTINGS[:version].short == '1.9' %>
2
2
  <%= javascript 'lookup_keys' %>
3
3
  <%= javascript 'template_input' %>
4
4
 
@@ -5,7 +5,7 @@
5
5
  remove_child_link('x', f, {:rel => 'twipsy', "data-title" => _('remove template input'), :'data-placement' => 'left', :class => 'fr badge badge-danger'}).html_safe do %>
6
6
  <%= text_f f, :name %>
7
7
  <%= checkbox_f f, :required %>
8
- <%= selectable_f f, :input_type, template_input_types_options, {}, :class => 'input_type_selector' %>
8
+ <%= selectable_f f, :input_type, template_input_types_options, {}, :class => 'input_type_selector without_select2' %>
9
9
  <div class="fact_input_type custom_input_type_fields" style="<%= f.object.fact_template_input? ? '' : 'display:none' %>">
10
10
  <%= text_f f, :fact_name, :class => 'fact_input_type', :required => true %>
11
11
  </div>
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecution
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -276,7 +276,8 @@ describe InputTemplateRenderer do
276
276
  context 'with existing variable implemented as smart variable' do
277
277
  let(:puppet_class) { FactoryGirl.create(:puppetclass, :environments => [environment], :hosts => [renderer.host]) }
278
278
  let(:lookup_key) do
279
- FactoryGirl.create(:lookup_key,
279
+ lookup_key_factory = SETTINGS[:version].short == '1.9' ? :lookup_key : :variable_lookup_key
280
+ FactoryGirl.create(lookup_key_factory,
280
281
  :key => 'client_key',
281
282
  :puppetclass => puppet_class,
282
283
  :overrides => {"fqdn=#{renderer.host.fqdn}" => "RSA KEY"})
@@ -359,10 +360,12 @@ describe InputTemplateRenderer do
359
360
  FactoryGirl.create(:puppetclass, :environments => [environment], :hosts => [renderer.host], :name => 'nginx')
360
361
  end
361
362
  let(:lookup_key) do
362
- FactoryGirl.create(:lookup_key, :as_smart_class_param, :with_override,
363
+ lookup_key_factory = SETTINGS[:version].short == '1.9' ? :lookup_key : :puppetclass_lookup_key
364
+ FactoryGirl.create(lookup_key_factory, :as_smart_class_param,
363
365
  :key => 'version',
364
366
  :puppetclass => puppet_class,
365
367
  :path => 'fqdn',
368
+ :override => true,
366
369
  :overrides => {"fqdn=#{renderer.host.fqdn}" => "1.4.7"})
367
370
  end
368
371
 
@@ -51,4 +51,16 @@ describe JobTemplate do
51
51
  template.default.must_equal true
52
52
  end
53
53
  end
54
+
55
+ context 'there is existing template invocation of a job template' do
56
+ let(:job_invocation) { FactoryGirl.create(:job_invocation, :with_template) }
57
+ let(:job_template) { job_invocation.template_invocations.first.template }
58
+
59
+ describe 'job template deletion' do
60
+ it 'succeeds' do
61
+ job_template.template_invocations.wont_be_empty
62
+ assert job_template.destroy
63
+ end
64
+ end
65
+ end
54
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-01 00:00:00.000000000 Z
11
+ date: 2015-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails