diff --git a/app/controllers/admin/growth_controller.rb b/app/controllers/admin/growth_controller.rb deleted file mode 100644 index e9fcd2f3c..000000000 --- a/app/controllers/admin/growth_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Admin - class GrowthController < Admin::ApplicationController - layout "admin" - end -end diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 330b3a3a5..7c0d00a96 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -14,7 +14,6 @@ module AdminHelper { name: "config", controller: "config" }, { name: "display_ads", controller: "display_ads" }, { name: "events", controller: "events" }, - { name: "growth", controller: "growth" }, { name: "html_variants", controller: "html_variants" }, { name: "listings", controller: "listings" }, { name: "moderator_actions", controller: "moderator_actions" }, diff --git a/app/models/growth.rb b/app/models/growth.rb deleted file mode 100644 index cc8910b25..000000000 --- a/app/models/growth.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Growth < ApplicationRecord - # This class exists to take advantage of Rolify for limiting authorization - # on internal reports. - # NOTE: It is not backed by a database table and should not be expected to - # function like a traditional Rails model - resourcify -end diff --git a/app/views/admin/growth/_results.html.erb b/app/views/admin/growth/_results.html.erb deleted file mode 100644 index b764c80fa..000000000 --- a/app/views/admin/growth/_results.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -
-

Past <%= num_days %> day new users (<%= User.where("registered_at > ?", num_days.day.ago).count %>)

-
-
- Overall data: -
- -
-
diff --git a/app/views/admin/growth/index.html.erb b/app/views/admin/growth/index.html.erb deleted file mode 100644 index 5cd4999fc..000000000 --- a/app/views/admin/growth/index.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

Onboarding

- -<%= render "results", num_days: 7 %> - -<%= render "results", num_days: 1 %> diff --git a/spec/requests/admin/growth_spec.rb b/spec/requests/admin/growth_spec.rb deleted file mode 100644 index 4fe981c7d..000000000 --- a/spec/requests/admin/growth_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -require "rails_helper" - -RSpec.describe "/admin/growth", type: :request do - context "when the user is not an admin" do - let(:user) { create(:user) } - - before do - sign_in user - end - - it "blocks the request" do - expect do - get "/admin/growth" - end.to raise_error(Pundit::NotAuthorizedError) - end - end - - context "when the user is a super admin" do - let(:super_admin) { create(:user, :super_admin) } - - before do - sign_in super_admin - get "/admin/growth" - end - - it "allows the request" do - expect(response).to have_http_status(:ok) - end - end - - context "when the user is a single resource admin" do - let(:single_resource_admin) { create(:user, :single_resource_admin, resource: Growth) } - - before do - sign_in single_resource_admin - get "/admin/growth" - end - - it "allows the request" do - expect(response).to have_http_status(:ok) - end - end - - context "when the user is the wrong single resource admin" do - let(:single_resource_admin) { create(:user, :single_resource_admin, resource: Article) } - - before do - sign_in single_resource_admin - end - - it "blocks the request" do - expect do - get "/admin/growth" - end.to raise_error(Pundit::NotAuthorizedError) - end - end -end