sqm-dashboards/spec/views/legacy/questions/index.html.erb_spec.rb
Nelson Jovel ad03606d66 Add benchmarks to survey and admin data items. Remove them from measures. Modify seeder
Calculate benchmarks for measures based on a weighted average of survey
and admin data items

Added architectural records
2021-12-28 14:10:34 +01:00

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