- <%= form_with url: admin_access_path, method: :post, class: "space-y-4" do |form| %>
+ <%= form_with url: admin_access_path, method: :get, class: "space-y-4" do |form| %>
<%= form.label :user_id, "User", class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
diff --git a/config/initializers/version.rb b/config/initializers/version.rb
index 4d0a548..12978eb 100644
--- a/config/initializers/version.rb
+++ b/config/initializers/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Clinch
- VERSION = "0.16.1"
+ VERSION = "0.16.2"
end
diff --git a/config/routes.rb b/config/routes.rb
index a208b34..1fc6759 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -96,7 +96,6 @@ Rails.application.routes.draw do
end
resources :groups
get "access", to: "access_checks#new"
- post "access", to: "access_checks#create"
end
# Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb)
diff --git a/test/controllers/admin/access_checks_controller_test.rb b/test/controllers/admin/access_checks_controller_test.rb
index cd56a8c..28ed83c 100644
--- a/test/controllers/admin/access_checks_controller_test.rb
+++ b/test/controllers/admin/access_checks_controller_test.rb
@@ -15,8 +15,8 @@ module Admin
assert_match "alice@example.com", response.body
end
- test "create returns 'can access' with via group when user is in an allowed group" do
- post admin_access_path, params: {
+ test "returns 'can access' with via group when user is in an allowed group" do
+ get admin_access_path, params: {
user_id: users(:alice).id,
application_id: @kavita.id
}
@@ -25,9 +25,9 @@ module Admin
assert_match "Administrators", response.body # alice is in admin_group; kavita has admin_group
end
- test "create returns 'cannot access' with reason when user shares no group with the app" do
+ test "returns 'cannot access' with reason when user shares no group with the app" do
lonely = User.create!(email_address: "lonely@example.com", password: "password123", skip_auto_assign: true)
- post admin_access_path, params: {
+ get admin_access_path, params: {
user_id: lonely.id,
application_id: @kavita.id
}
@@ -36,8 +36,8 @@ module Admin
assert_match "shares no group", response.body
end
- test "create renders form unchanged when ids are missing" do
- post admin_access_path, params: {user_id: "", application_id: ""}
+ test "renders form unchanged when ids are missing" do
+ get admin_access_path, params: {user_id: "", application_id: ""}
assert_response :success
# No result panel should render. The panel-only phrases:
refute_match "Granted via", response.body