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

pulibrary / tigerdata-app / 5cde93f4-daa3-4f98-bc15-0daddc4f2a00

30 Jul 2025 06:39PM UTC coverage: 74.099% (-1.5%) from 75.625%
5cde93f4-daa3-4f98-bc15-0daddc4f2a00

Pull #1657

circleci

web-flow
Merge branch 'main' into i1632-save-data-users
Pull Request #1657: Add data users to a project after it is created in mediaflux

0 of 62 new or added lines in 3 files covered. (0.0%)

1 existing line in 1 file now uncovered.

2240 of 3023 relevant lines covered (74.1%)

309.56 hits per line

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

0.0
/app/models/mediaflux/project_user_add_request.rb
1
# frozen_string_literal: true
NEW
2
module Mediaflux
×
NEW
3
  class ProjectUserAddRequest < Request
×
NEW
4
    attr_reader :project, :project_metadata
×
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
NEW
9
    def initialize(session_token:, project:)
×
NEW
10
      super(session_token: session_token)
×
NEW
11
      @project = project
×
NEW
12
      @id = @project.mediaflux_id
×
NEW
13
      @xml_namespace = self.class.default_xml_namespace
×
NEW
14
      @xml_namespace_uri = self.class.default_xml_namespace_uri
×
15

NEW
16
      @all_data_users = @project.metadata_model.ro_users + @project.metadata_model.rw_users
×
NEW
17
    end
×
18

19
    # Specifies the Mediaflux service to use when updating assets
20
    # @return [String]
NEW
21
    def self.service
×
NEW
22
      "tigerdata.project.user.add"
×
NEW
23
    end
×
24

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

NEW
32
    private
×
33

34
      # rubocop:disable Metrics/MethodLength
35
      # rubocop:disable Metrics/AbcSize
36
      # rubocop:disable Metrics/BlockLength
37
      #
38
      # This is what the call would look like from aterm:
39
      # tigerdata.project.user.add \
40
      #   :id 1234 \
41
      #   :data-user "md1908" \
42
      #
43
      # OR FOR MULTIPLE USERS:
44
      # tigerdata.project.user.add \
45
      #   :id 1234 \
46
      #   :data-user "md1908" \
47
      #   :data-user "md1909" \
48
      #   :data-user "md1910" \
49
      #
NEW
50
      def build_http_request_body(name:)
×
NEW
51
        super do |xml|
×
NEW
52
          xml.args do
×
NEW
53
            xml.id @id
×
54
            # send each user in the list
NEW
55
            @all_data_users.each do |user|
×
NEW
56
              xml.send("data-user") do
×
NEW
57
                xml.text(user)
×
NEW
58
              end
×
NEW
59
            end
×
NEW
60
          end
×
NEW
61
        end
×
NEW
62
      end
×
63
    # rubocop:enable Metrics/AbcSize
64
    # rubocop:enable Metrics/MethodLength
65
    # rubocop:enable Metrics/BlockLength
NEW
66
  end
×
NEW
67
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