mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
adding more authentication, fixing category bug
This commit is contained in:
parent
60a2982724
commit
42fd3edbae
10 changed files with 28 additions and 93 deletions
|
|
@ -23,6 +23,7 @@ RSpec.describe QuestionsController, type: :controller do
|
|||
# This should return the minimal set of attributes required to create a valid
|
||||
# Question. As you add validations to Question, be sure to
|
||||
# adjust the attributes here as well.
|
||||
let!(:user) { User.create(email: 'test@test.com', password: '123456') }
|
||||
let (:category) { Category.create!(name: 'Category') }
|
||||
let(:valid_attributes) {
|
||||
{
|
||||
|
|
@ -45,6 +46,10 @@ RSpec.describe QuestionsController, type: :controller do
|
|||
# QuestionsController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
before :each do
|
||||
sign_in user
|
||||
end
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all questions as @questions" do
|
||||
question = Question.create! valid_attributes
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe SchedulesController, type: :controller do
|
||||
|
||||
let!(:user) { User.create(email: 'test@test.com', password: '123456') }
|
||||
let!(:school) { School.create!(name: 'School') }
|
||||
|
||||
let!(:recipients) { create_recipients(school, 3) }
|
||||
|
|
@ -54,12 +55,9 @@ RSpec.describe SchedulesController, type: :controller do
|
|||
# SchedulesController. Be sure to keep this updated too.
|
||||
let(:valid_session) { {} }
|
||||
|
||||
describe "GET #index" do
|
||||
it "assigns all schedules as @schedules" do
|
||||
schedule = Schedule.create! valid_attributes
|
||||
get :index, params: {school_id: school.id}, session: valid_session
|
||||
expect(assigns(:schedules)).to eq([schedule])
|
||||
end
|
||||
before :each do
|
||||
user.user_schools.create(school: school)
|
||||
sign_in user
|
||||
end
|
||||
|
||||
describe "GET #show" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue