-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Authentication guard clause in work reports controller (#6824)
* authentication guard clause and test * rubocop * defining pageviews and downloads on the same line to get around clsss line limit --------- Co-authored-by: Daniel Pierce <[email protected]>
- Loading branch information
1 parent
ee24216
commit 3083b6f
Showing
2 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
spec/controllers/hyrax/admin/analytics/work_reports_controller_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
require 'rails_helper' | ||
|
||
RSpec.describe Hyrax::Admin::Analytics::WorkReportsController, type: :controller do | ||
routes { Hyrax::Engine.routes } | ||
describe 'GET #index' do | ||
context 'when user is not logged in' do | ||
it 'redirects to the login page' do | ||
get :index | ||
expect(response).to be_redirect | ||
expect(flash[:alert]).to eq("You need to sign in or sign up before continuing.") | ||
end | ||
end | ||
end | ||
end |