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

pulibrary / tigerdata-app / a829b9c5-1dc3-477f-a44e-45890dfc33cb

24 Nov 2025 02:38PM UTC coverage: 87.586% (-0.5%) from 88.064%
a829b9c5-1dc3-477f-a44e-45890dfc33cb

Pull #2235

circleci

carolyncole
Do not redirect from home page when login is disabled
fixes #2188
Pull Request #2235: Do not redirect from home page when login is disabled

1 of 5 new or added lines in 2 files covered. (20.0%)

794 existing lines in 37 files now uncovered.

2787 of 3182 relevant lines covered (87.59%)

361.47 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
2
module Mediaflux
3✔
3
  class ProjectUserAddRequest < Request
3✔
4
    attr_reader :project, :project_metadata
3✔
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
9
    def initialize(session_token:, project:)
3✔
10
      super(session_token: session_token)
18✔
11
      @project = project
18✔
12
      @id = @project.mediaflux_id
18✔
13
      @xml_namespace = self.class.default_xml_namespace
18✔
14
      @xml_namespace_uri = self.class.default_xml_namespace_uri
18✔
15

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

21
    # Specifies the Mediaflux service to use when updating assets
22
    # @return [String]
23
    def self.service
3✔
24
      "tigerdata.project.user.add"
36✔
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.
30
    def debug_output
3✔
31
      response_xml.xpath("response/reply/result/result").to_s
18✔
32
    end
33

34
    private
3✔
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
      #
52
      def build_http_request_body(name:)
3✔
53
        super do |xml|
36✔
54
          xml.args do
36✔
55
            xml.id @id
36✔
56
            # send each user in the list
57
            @ro_users.each do |user|
36✔
58
              xml.send("data-user") do
36✔
59
                xml.parent.set_attribute("readonly", "true")
36✔
60
                xml.text(user)
36✔
61
              end
62
            end
63
            @rw_users.each do |user|
36✔
UNCOV
64
              xml.send("data-user") do
10✔
UNCOV
65
                xml.parent.set_attribute("readonly", "false")
10✔
UNCOV
66
                xml.text(user)
10✔
67
              end
68
            end
69
          end
70
        end
71
      end
72
    # rubocop:enable Metrics/AbcSize
73
    # rubocop:enable Metrics/MethodLength
74
    # rubocop:enable Metrics/BlockLength
75
  end
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