Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused routes for feedback #2631

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions app/views/shared/_sul_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@
<li>
<%= link_to t('.my_account'), "https://mylibrary.stanford.edu/" %>
</li>
<% unless current_page?(feedback_form_path) %>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path is for a POST route, which never returns HTML. The condition could never be met.

<li>
<%= link_to "#feedback-form", role: 'button', data: {'bs-toggle':"collapse", 'bs-target':"#feedback-form"} do %>
Feedback
<% end %>
</li>
<% end %>
<li>
<%= link_to "#feedback-form", role: 'button', data: {'bs-toggle':"collapse", 'bs-target':"#feedback-form"} do %>
Feedback
<% end %>
</li>
</ul>
</nav>
</div>
</div>
<div id="feedback-form" class="feedback-form-container collapse">
<%= render template: 'feedback_forms/new' unless current_page?(feedback_form_path) %>
<%= render 'feedback_forms/new' %>
</div>
<!-- Application header -->
<div id="app-header" class="text-white bg-cardinal py-3 d-flex">
Expand Down
3 changes: 1 addition & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,5 @@
post :comment, as: :comment
end
end
resource :feedback_form, path: 'feedback', only: %I[new, create]
get 'feedback' => 'feedback_forms#new'
resource :feedback_form, path: 'feedback', only: :create
end
5 changes: 0 additions & 5 deletions spec/features/axe_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
visit new_patron_request_path(instance_hrid: 'a12345', origin_location_code: 'SAL3-STACKS')
expect(page).to be_accessible
end

it 'validates the feedback form page' do
visit feedback_form_path
expect(page).to be_accessible
end
end

context 'with a user' do
Expand Down
6 changes: 3 additions & 3 deletions spec/requests/feedback_forms_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

require 'rails_helper'

RSpec.describe 'FeedbackForm', type: :feature do
RSpec.describe 'The feedback form', type: :feature do
let(:current_user?) { false }
let(:user) { create(:sso_user) }

context 'when not logged in' do
it 'reCAPTCHA challenge is present' do
visit feedback_path
visit root_path
expect(page).to have_css '.requests-captcha'
end
end
Expand All @@ -19,7 +19,7 @@
end

it 'reCAPTCHA challenge is NOT present' do
visit feedback_path
visit root_path
expect(page).to have_no_css '.requests-captcha'
end

Expand Down
Loading