[deploy] Update "/internal/badges" route to "/internal/badge_achievements" (#9643)

* Update /internal/badges route to be /internal/badges/award
  -Updates the route
  -Redirects the old route, /internal/badges, to the new route

* Updates the redirect in #award_badges to correct route
  -Updates #award_badges in Internal::Badges::Controller
   to account for the new route, /internal/badges/award

* Adjust route to be /internal/badges/award in admin_awards_badges_spec.rb

* Adjust URL to be /internal/badges/award in badges_spec.rb

* Replace /internal/badges/award with /internal/badge_achievements to follow convention
  -Updates the old route in routes.rb
  -Updates the old route in #award_badges in Internal::Badges::Controller
  -Updates the old route in admin_awards_badges_spec.rb
  -Updates the old route in badges_spec.rb
This commit is contained in:
Julianna Tetreault 2020-08-06 07:58:19 -06:00 committed by GitHub
parent dbbe158d21
commit 5daf162629
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View file

@ -17,7 +17,7 @@ module Internal
redirect_to internal_badges_url
rescue ArgumentError => e
flash[:danger] = e.message
redirect_to "/internal/badges"
redirect_to "/internal/badge_achievements"
end
private

View file

@ -115,7 +115,8 @@ Rails.application.routes.draw do
end
resources :webhook_endpoints, only: :index
resource :config
resources :badges, only: :index
resources :badges, only: %i[index], path: "/badge_achievements"
get "/badges", to: redirect("/internal/badge_achievements")
post "badges/award_badges", to: "badges#award_badges"
resources :secrets, only: %i[index]
put "secrets", to: "secrets#update"

View file

@ -1,9 +1,9 @@
require "rails_helper"
require "requests/shared_examples/internal_policy_dependant_request"
RSpec.describe "/internal/badges", type: :request do
RSpec.describe "/internal/badge_achievements", type: :request do
it_behaves_like "an InternalPolicy dependant request", Badge do
let(:request) { get "/internal/badges" }
let(:request) { get "/internal/badge_achievements" }
end
describe "POST /internal/badges/award_badges" do

View file

@ -22,7 +22,7 @@ RSpec.describe "Admin awards badges", type: :system do
before do
create_list :badge, 5
sign_in admin
visit "/internal/badges"
visit "/internal/badge_achievements"
end
it "loads the view" do