pull/1/head
parent
e622a01dd0
commit
813efca493
@ -0,0 +1,13 @@
|
|||||||
|
class DashboardController < ApplicationController
|
||||||
|
|
||||||
|
def index
|
||||||
|
@school = School.find_by_slug school_slug
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def school_slug
|
||||||
|
params[:school_id]
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<h1><%= @school.name %></h1>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
require "rails_helper"
|
||||||
|
|
||||||
|
RSpec.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 views a school dashboard" do
|
||||||
|
visit "/districts/winchester/schools/#{school.slug}/dashboard?year=2020-21"
|
||||||
|
|
||||||
|
expect(page).to have_text(school.name)
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in new issue