Skip to content

Commit 0b297b8

Browse files
committed
Add pending test on maintaining columns order
1 parent c6ab5ae commit 0b297b8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spec/datagrid/columns_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,4 +589,21 @@ def capitalized_name
589589
expect(grid.assets.order_values).to be_blank
590590
end
591591
end
592+
593+
describe "#data_hash" do
594+
it "works" do
595+
pending
596+
class DataHashGrid
597+
include Datagrid
598+
scope { Entry }
599+
column(:name, order: true)
600+
end
601+
grid1 = DataHashGrid.new(order: :name)
602+
grid2 = DataHashGrid.new(order: :name, descending: true)
603+
Entry.create!(name: 'one')
604+
Entry.create!(name: 'two')
605+
expect(grid1.data_hash).to eq([{name: 'one'}, {name: 'two'}])
606+
expect(grid2.data_hash).to eq([{name: 'two'}, {name: 'one'}])
607+
end
608+
end
592609
end

0 commit comments

Comments
 (0)