Skip to content

Commit

Permalink
Use record instead of ems instance var in textual authentication status
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Nov 30, 2017
1 parent 07a21f8 commit 3f3d11f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/helpers/textual_mixins/textual_authentications_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def map_authentications(authentications)
end

def textual_authentications_status
authentications = @ems.authentications.order(:authtype).collect
return [{ :label => _("%{label} Authentication") % { :label => @ems.default_authentication_type.to_s.titleize },
authentications = @record.authentications.order(:authtype).collect
return [{ :label => _("%{label} Authentication") % { :label => @record.default_authentication_type.to_s.titleize },
:title => t = _("None"),
:value => t }] if authentications.blank?

Expand Down
8 changes: 4 additions & 4 deletions app/helpers/textual_mixins/textual_metrics_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ def textual_metrics_status
:label => _("Last Metrics Collection"),
:title => _("None"),
:value => _("None")
} unless @ems.last_metrics_update_date
} unless @record.last_metrics_update_date

status = (@ems.last_metrics_error || :valid).to_s.titleize
updated_on = @ems.last_metrics_update_date
last_valid_on = @ems.last_metrics_success_date
status = (@record.last_metrics_error || :valid).to_s.titleize
updated_on = @record.last_metrics_update_date
last_valid_on = @record.last_metrics_success_date

{
:label => _("Last Metrics Collection"),
Expand Down
13 changes: 13 additions & 0 deletions spec/controllers/ems_container_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,18 @@
end
end

describe '#download_summary_pdf' do
let(:provider) { FactoryGirl.create(:ems_container) }
let(:generator) { dup }

it 'returns with a PDF' do
allow(PdfGenerator).to receive(:new).and_return(generator)
allow(generator).to receive(:pdf_from_string)
expect(response.status).to eq(200)

get :download_summary_pdf, :id => provider.id
end
end

include_examples '#download_summary_pdf', :ems_kubernetes
end

0 comments on commit 3f3d11f

Please sign in to comment.