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

pulibrary / tigerdata-app / 085a83f3-f8ba-4ace-b5ad-5cb6d3d55a35

24 Oct 2025 02:47PM UTC coverage: 65.148% (-26.1%) from 91.202%
085a83f3-f8ba-4ace-b5ad-5cb6d3d55a35

Pull #2057

circleci

hectorcorrea
Make test more forgiving
Pull Request #2057: Dashboard displays projects straights from Mediaflux

11 of 87 new or added lines in 4 files covered. (12.64%)

625 existing lines in 35 files now uncovered.

2088 of 3205 relevant lines covered (65.15%)

181.75 hits per line

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

100.0
/app/models/mediaflux/project_user_add_request.rb
1
# frozen_string_literal: true
UNCOV
2
module Mediaflux
1✔
UNCOV
3
  class ProjectUserAddRequest < Request
1✔
UNCOV
4
    attr_reader :project, :project_metadata
1✔
5

6
    # Constructor
7
    # @param session_token [String] the API token for the authenticated session
8
    # @param project [Project] project to be created in Mediaflux
UNCOV
9
    def initialize(session_token:, project:)
1✔
UNCOV
10
      super(session_token: session_token)
13✔
UNCOV
11
      @project = project
13✔
UNCOV
12
      @id = @project.mediaflux_id
13✔
UNCOV
13
      @xml_namespace = self.class.default_xml_namespace
13✔
UNCOV
14
      @xml_namespace_uri = self.class.default_xml_namespace_uri
13✔
15

UNCOV
16
      @all_data_users = @project.metadata_model.ro_users + @project.metadata_model.rw_users
13✔
UNCOV
17
      @ro_users = @project.metadata_model.ro_users
13✔
UNCOV
18
      @rw_users = @project.metadata_model.rw_users
13✔
UNCOV
19
    end
20

21
    # Specifies the Mediaflux service to use when updating assets
22
    # @return [String]
UNCOV
23
    def self.service
1✔
UNCOV
24
      "tigerdata.project.user.add"
26✔
UNCOV
25
    end
26

27
    # Returns the entire response returned by the project create service.
28
    # This includes debug information that is useful to troubleshoot issues
29
    # if the request fails.
UNCOV
30
    def debug_output
1✔
UNCOV
31
      response_xml.xpath("response/reply/result/result").to_s
13✔
UNCOV
32
    end
33

UNCOV
34
    private
1✔
35

36
      # rubocop:disable Metrics/MethodLength
37
      # rubocop:disable Metrics/AbcSize
38
      # rubocop:disable Metrics/BlockLength
39
      #
40
      # This is what the call would look like from aterm:
41
      # tigerdata.project.user.add \
42
      #   :id 1234 \
43
      #   :data-user "md1908" \
44
      #
45
      # OR FOR MULTIPLE USERS:
46
      # tigerdata.project.user.add \
47
      #   :id 1234 \
48
      #   :data-user "md1908" \
49
      #   :data-user "md1909" \
50
      #   :data-user "md1910" \
51
      #
UNCOV
52
      def build_http_request_body(name:)
1✔
UNCOV
53
        super do |xml|
26✔
UNCOV
54
          xml.args do
26✔
UNCOV
55
            xml.id @id
26✔
56
            # send each user in the list
UNCOV
57
            @ro_users.each do |user|
26✔
UNCOV
58
              xml.send("data-user") do
26✔
UNCOV
59
                xml.parent.set_attribute("readonly", "true")
26✔
UNCOV
60
                xml.text(user)
26✔
UNCOV
61
              end
UNCOV
62
            end
UNCOV
63
            @rw_users.each do |user|
26✔
64
              xml.send("data-user") do
2✔
65
                xml.parent.set_attribute("readonly", "false")
2✔
66
                xml.text(user)
2✔
UNCOV
67
              end
UNCOV
68
            end
UNCOV
69
          end
UNCOV
70
        end
UNCOV
71
      end
72
    # rubocop:enable Metrics/AbcSize
73
    # rubocop:enable Metrics/MethodLength
74
    # rubocop:enable Metrics/BlockLength
UNCOV
75
  end
UNCOV
76
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