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

digitaltom / mapforge / 12526440524

28 Dec 2024 12:07PM UTC coverage: 99.485% (+0.03%) from 99.451%
12526440524

Pull #231

github

web-flow
Merge 4be9abc81 into d7a245e30
Pull Request #231: First stub for omniauth login support

25 of 25 new or added lines in 4 files covered. (100.0%)

1 existing line in 1 file now uncovered.

386 of 388 relevant lines covered (99.48%)

104.63 hits per line

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

96.97
/app/controllers/maps_controller.rb
1
class MapsController < ApplicationController
1✔
2
  before_action :set_map, only: %i[show properties]
1✔
3

4
  def index
1✔
5
    @maps = Map.where.not(private: true).includes(:layers).order(updated_at: :desc)
2✔
6
  end
7

8
  def show
1✔
9
    @map_properties = @map.properties
107✔
10
    gon.map_id = params[:id]
107✔
11
    gon.map_mode = (params[:id] == @map.id.to_s) ? "rw" : "ro"
107✔
12
    gon.map_mode = "static" if params["static"]
107✔
13
    @map_mode = gon.map_mode
107✔
14
    gon.csrf_token = form_authenticity_token
107✔
15
    gon.map_properties = @map_properties
107✔
16

17
    respond_to do |format|
107✔
18
      format.html do
107✔
19
        case params["engine"]
51✔
20
        when "deck"
21
          render "deck"
1✔
22
        else
23
          render "maplibre"
50✔
24
        end
25
      end
26
      format.json { render json: @map.to_json }
108✔
27
      format.geojson { render json: @map.to_geojson }
161✔
28
      format.gpx { send_data @map.to_gpx, filename: @map.public_id + ".gpx" }
108✔
29
    end
30
  end
31

32
  def create
1✔
33
    @map = Map.create!(map_params)
1✔
34

35
    redirect_to map_url(@map), notice: "Map was successfully created."
1✔
36
  end
37

38
  def properties
1✔
39
    render json: @map.properties.as_json
7✔
40
  end
41

42
  # some maplibre style tries to load eg. /atm_11; catching those calls here
43
  # :nocov:
44
  def catchall
✔
UNCOV
45
    head :ok
×
46
  end
47
  # :nocov:
48

49
  private
1✔
50

51
  # Use callbacks to share common setup or constraints between actions.
52
  def set_map
1✔
53
    @map = Map.find_by(public_id: params[:id]) || Map.find_by(id: params[:id])
114✔
54
    head :not_found unless @map
114✔
55
  end
56

57
  # Only allow a list of trusted parameters through.
58
  def map_params
1✔
59
    params.fetch(:map, {})
1✔
60
  end
61
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

© 2026 Coveralls, Inc