Skip to content

Commit

Permalink
Merge pull request #23 from dkniffin/add-test-for-position-updating
Browse files Browse the repository at this point in the history
Add test for position column
  • Loading branch information
dkniffin authored Jul 11, 2024
2 parents 81ba02a + 8332731 commit fe639cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/dummy/app/admin/item_queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
reorderable_table_for item_queue.items do
column :name
column :description
column :position, class: "position"
end
end
end
4 changes: 4 additions & 0 deletions spec/features/reorderable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@

expect(item2.name).to appear_before(item1.name)

# Check that the position column updated immediately
expect(row1.find(".position")).to have_content("2")
expect(row2.find(".position")).to have_content("1")

sleep 1 # Give some time for the DB to update

expect(item1.reload.position).to eq(2)
Expand Down

0 comments on commit fe639cf

Please sign in to comment.