• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / tigerdata-app / 5205f704-d89d-4c43-8cfa-9e6783edc33a

29 Feb 2024 07:04PM UTC coverage: 60.206% (-29.9%) from 90.092%
5205f704-d89d-4c43-8cfa-9e6783edc33a

push

circleci

jrgriffiniii
Ensuring that the storage usage and storage capacity is retrieved for
Mediaflux Projects and rendered on the "contents" Project View

11 of 34 new or added lines in 4 files covered. (32.35%)

451 existing lines in 34 files now uncovered.

935 of 1553 relevant lines covered (60.21%)

9.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.48
/app/mailers/tigerdata_mailer.rb
1
# frozen_string_literal: true
2
class TigerdataMailer < ApplicationMailer
1✔
3
  def project_creation
1✔
4
    config = Rails.application.config.tigerdata_mail[:project_creation]
2✔
5
    @project_id = params[:project_id]
2✔
6

7
    raise(ArgumentError, "Invalid Project ID provided for the TigerdataMailer: #{@project_id}") if project.nil?
2✔
8

9
    # attaching json response  to the mailer
10
    json_content = project_metadata.to_json
1✔
11
    attachments["#{filebase}.json"] = {
1✔
12
      mime_type: "application/json",
13
      content: json_content
14
    }
15

16
    # attaching xml response to the mailer
17
    xml_content = project.to_xml
1✔
UNCOV
18
    attachments["#{filebase}.xml"] = {
×
19
      mime_type: "application/xml",
20
      content: xml_content
21
    }
22

UNCOV
23
    mail(to: config[:to_email], subject: "Project Creation Request", cc: config[:cc_email])
×
24
  end
25

26
  private
1✔
27

28
    def project
1✔
29
      @project ||= Project.find_by(id: @project_id)
8✔
30
    end
31

32
    def project_metadata
1✔
33
      return if project.nil?
2✔
34

35
      project.metadata
2✔
36
    end
37

38
    def project_metadata_id
1✔
39
      return if project.nil?
1✔
40

41
      project_metadata[:project_id]
1✔
42
    end
43

44
    def filebase
1✔
45
      @filebase ||= project_metadata_id.tr("/", "_")
1✔
46
    end
47
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc