mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 15:38:21 -07:00
Unify how we sort SQM Categories
This commit is contained in:
parent
934d0bda0e
commit
882fa84de9
8 changed files with 57 additions and 4 deletions
12
spec/controllers/home_controller_spec.rb
Normal file
12
spec/controllers/home_controller_spec.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe HomeController, type: :controller do
|
||||
let!(:categories) {
|
||||
[create(:sqm_category, name: 'Second', sort_index: 2), create(:sqm_category, name: 'First', sort_index: 1)]
|
||||
}
|
||||
|
||||
it 'fetches categories sorted by sort_index' do
|
||||
get :index
|
||||
expect(assigns(:categories).map(&:name)).to eql ['First', 'Second']
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue