mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-11 16:30:35 -07:00
Calculate benchmarks for measures based on a weighted average of survey and admin data items Added architectural records
40 lines
1.4 KiB
Ruby
40 lines
1.4 KiB
Ruby
require 'rails_helper'
|
|
|
|
module Legacy
|
|
RSpec.describe 'legacy/questions/index', type: :view do
|
|
before(:each) do
|
|
assign(:questions, [
|
|
Question.create!(
|
|
text: 'Text',
|
|
option1: 'Option1',
|
|
option2: 'Option2',
|
|
option3: 'Option3',
|
|
option4: 'Option4',
|
|
option5: 'Option5',
|
|
category: Category.create(name: 'Category 1')
|
|
),
|
|
Question.create!(
|
|
text: 'Text',
|
|
option1: 'Option1',
|
|
option2: 'Option2',
|
|
option3: 'Option3',
|
|
option4: 'Option4',
|
|
option5: 'Option5',
|
|
category: Category.create(name: 'Category 2')
|
|
)
|
|
])
|
|
end
|
|
|
|
it 'renders a list of questions' do
|
|
render(template: 'legacy/questions/index')
|
|
assert_select 'tr>td', text: 'Text'.to_s, count: 2
|
|
assert_select 'tr>td', text: 'Option1'.to_s, count: 2
|
|
assert_select 'tr>td', text: 'Option2'.to_s, count: 2
|
|
assert_select 'tr>td', text: 'Option3'.to_s, count: 2
|
|
assert_select 'tr>td', text: 'Option4'.to_s, count: 2
|
|
assert_select 'tr>td', text: 'Option5'.to_s, count: 2
|
|
assert_select 'tr>td', text: 'Category 1', count: 1
|
|
assert_select 'tr>td', text: 'Category 2', count: 1
|
|
end
|
|
end
|
|
end
|