18F/identity-idp

View on GitHub
app/controllers/test/telephony_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module Test
  class TelephonyController < ApplicationController
    layout 'no_card'

    before_action :render_not_found_in_production

    def index
      @messages = Telephony::Test::Message.messages.reverse
      @calls = Telephony::Test::Call.calls.reverse
    end

    def destroy
      Telephony::Test::Message.clear_messages
      Telephony::Test::Call.clear_calls
      redirect_to test_telephony_url
    end

    private

    def render_not_found_in_production
      return unless Rails.env.production?
      render_not_found
    end
  end
end