mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
School dashboard is protected by district-level authentication
[Finishes #179513281]
This commit is contained in:
parent
813efca493
commit
771c1c3209
2 changed files with 24 additions and 2 deletions
|
|
@ -1,14 +1,27 @@
|
|||
require "rails_helper"
|
||||
|
||||
RSpec.feature "School dashboard", type: feature do
|
||||
feature "School dashboard", type: feature do
|
||||
let(:district) { District.create name: 'Winchester' }
|
||||
let(:school) {
|
||||
School.create name: 'Winchester High School', slug: 'winchester-high-school', district: district
|
||||
}
|
||||
|
||||
scenario "User authentication fails" do
|
||||
page.driver.browser.basic_authorize('wrong username', 'wrong password')
|
||||
|
||||
visit "/districts/winchester/schools/#{school.slug}/dashboard?year=2020-21"
|
||||
|
||||
expect(page).not_to have_text(school.name)
|
||||
end
|
||||
|
||||
scenario "User views a school dashboard" do
|
||||
page.driver.browser.basic_authorize(username, password)
|
||||
|
||||
visit "/districts/winchester/schools/#{school.slug}/dashboard?year=2020-21"
|
||||
|
||||
expect(page).to have_text(school.name)
|
||||
end
|
||||
|
||||
let(:username) { 'winchester' }
|
||||
let(:password) { 'winchester!' }
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue