mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
remove authentication check. Finishes #181920761
This commit is contained in:
parent
c49dee0a63
commit
cbc8ba59ba
2 changed files with 0 additions and 52 deletions
|
|
@ -1,7 +1,6 @@
|
|||
class SqmApplicationController < ApplicationController
|
||||
protect_from_forgery with: :exception, prepend: true
|
||||
before_action :set_schools_and_districts
|
||||
before_action :authenticate_district
|
||||
|
||||
private
|
||||
|
||||
|
|
@ -28,12 +27,4 @@ class SqmApplicationController < ApplicationController
|
|||
def school_slug
|
||||
params[:school_id]
|
||||
end
|
||||
|
||||
def authenticate(username, password)
|
||||
return true if username == 'boston'
|
||||
|
||||
authenticate_or_request_with_http_basic do |u, p|
|
||||
u == username && p == password
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe 'authentication' do
|
||||
let(:district) { create(:district) }
|
||||
let(:school) { create(:school, district:) }
|
||||
let(:academic_year) { create(:academic_year) }
|
||||
|
||||
context 'when using the wrong credentials' do
|
||||
before :each do
|
||||
page.driver.browser.basic_authorize('wrong username', 'wrong password')
|
||||
end
|
||||
it 'does not show any information' do
|
||||
visit overview_path
|
||||
|
||||
expect(page).not_to have_text(school.name)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using the right credentials' do
|
||||
before :each do
|
||||
page.driver.browser.basic_authorize(username, password)
|
||||
end
|
||||
it 'does show information' do
|
||||
visit overview_path
|
||||
|
||||
expect(page).to have_text(school.name)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def username
|
||||
district.name.downcase
|
||||
end
|
||||
|
||||
def password
|
||||
"#{username}!"
|
||||
end
|
||||
|
||||
def overview_path
|
||||
district_school_overview_index_path(district, school, year: academic_year.range)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue