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

source-academy / backend / 18dc689a4df4836fc6967bf0f74dc252964bd175-PR-1180

08 Sep 2024 06:14PM UTC coverage: 79.088% (-15.3%) from 94.372%
18dc689a4df4836fc6967bf0f74dc252964bd175-PR-1180

Pull #1180

github

josh1248
Change appropriate routes into admin scope
Pull Request #1180: Transfer groundControl (and admin panel) from staff to admin route

7 of 12 new or added lines in 1 file covered. (58.33%)

499 existing lines in 25 files now uncovered.

2602 of 3290 relevant lines covered (79.09%)

1023.2 hits per line

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

0.0
/lib/cadet_web/admin_views/admin_goals_view.ex
1
defmodule CadetWeb.AdminGoalsView do
2
  use CadetWeb, :view
3
  use Timex
4

5
  def render("index.json", %{goals: goals}) do
UNCOV
6
    render_many(goals, CadetWeb.AdminGoalsView, "goal.json", as: :goal)
×
7
  end
8

9
  def render("index_goals_with_progress.json", %{goals: goals}) do
UNCOV
10
    render_many(goals, CadetWeb.AdminGoalsView, "goal_with_progress.json", as: :goal)
×
11
  end
12

13
  def render("goal.json", %{goal: goal}) do
UNCOV
14
    transform_map_for_view(goal, %{
×
15
      uuid: :uuid,
16
      text: :text,
17
      targetCount: :target_count,
18
      type: :type,
19
      meta: :meta
20
    })
21
  end
22

23
  def render("goal_with_progress.json", %{goal: goal}) do
UNCOV
24
    transform_map_for_view(goal, %{
×
25
      uuid: :uuid,
26
      text: :text,
27
      count: fn
UNCOV
28
        %{progress: [%{count: count}]} -> count
×
29
        _ -> 0
×
30
      end,
31
      completed: fn
UNCOV
32
        %{progress: [%{completed: completed}]} -> completed
×
33
        _ -> false
×
34
      end,
35
      targetCount: :target_count,
36
      type: :type,
37
      meta: :meta,
38
      achievementUuids:
UNCOV
39
        &Enum.map(&1.achievements, fn achievement -> achievement.achievement_uuid end)
×
40
    })
41
  end
42
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