FIX: keep correct ordering on admin badges
This commit is contained in:
parent
b196de0821
commit
5a3466a6c3
|
@ -4,7 +4,9 @@ class Admin::BadgesController < Admin::AdminController
|
|||
data = {
|
||||
badge_types: BadgeType.all.order(:id).to_a,
|
||||
badge_groupings: BadgeGrouping.all.order(:position).to_a,
|
||||
badges: Badge.all.to_a,
|
||||
badges: Badge.includes(:badge_grouping)
|
||||
.references(:badge_grouping)
|
||||
.order('badge_groupings.position, badge_type_id, badges.name').to_a,
|
||||
protected_system_fields: Badge.protected_system_fields,
|
||||
triggers: Badge.trigger_hash
|
||||
}
|
||||
|
|
|
@ -6,6 +6,13 @@ describe Admin::BadgesController do
|
|||
let!(:user) { log_in(:admin) }
|
||||
let!(:badge) { Fabricate(:badge) }
|
||||
|
||||
context 'index' do
|
||||
it 'returns badge index' do
|
||||
xhr :get, :index
|
||||
response.should be_success
|
||||
end
|
||||
end
|
||||
|
||||
context '.save_badge_groupings' do
|
||||
|
||||
it 'can save badge groupings' do
|
||||
|
|
Loading…
Reference in New Issue