You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
348 B
13 lines
348 B
require 'rails_helper'
|
|
|
|
describe HomeController, type: :controller do
|
|
let!(:categories) do
|
|
[create(:category, name: 'Second', sort_index: 2), create(:category, name: 'First', sort_index: 1)]
|
|
end
|
|
|
|
it 'fetches categories sorted by sort_index' do
|
|
get :index
|
|
expect(assigns(:categories).map(&:name)).to eql %w[First Second]
|
|
end
|
|
end
|