Correctly handle trying to edit not existing settings tab (#1011)
This commit is contained in:
parent
bddfc8a69d
commit
2b2a7afb03
2 changed files with 7 additions and 0 deletions
|
|
@ -173,6 +173,8 @@ class UsersController < ApplicationController
|
|||
%0A
|
||||
YOUR-DEV-USERNAME-HERE
|
||||
HEREDOC
|
||||
else
|
||||
not_found unless @tab_list.map { |t| t.downcase.gsub(" ", "-") }.include? @tab
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ RSpec.describe "UserSettings", type: :request do
|
|||
end
|
||||
end
|
||||
|
||||
it "handles unknown settings tab properly" do
|
||||
expect { get "/settings/does-not-exist" }.
|
||||
to raise_error(ActionController::RoutingError)
|
||||
end
|
||||
|
||||
it "doesn't let user access membership if user has no monthly_dues" do
|
||||
get "/settings/membership"
|
||||
expect(response.body).not_to include("Settings for")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue