Sha256: 03b7e4f2c9bfe603364214624afa1d7ed0e37fa42397e022d6419bf3ba10dfeb

Contents?: true

Size: 947 Bytes

Versions: 1

Compression:

Stored size: 947 Bytes

Contents

# frozen_string_literal: true

require "rails_helper"

RSpec.describe "Backend - Collection Entries (HTML)", type: :feature do
  describe "listing sorting", js: true do
    let(:collection) { create(:collection, slug: "amazing") }

    before do
      stub_authorization!

      create(:field, :required, collection: collection, slug: "name")

      create(:entry, collection: collection, value: { name: "Entry A" })
      create(:entry, collection: collection, value: { name: "Entry B" })
      create(:entry, collection: collection, value: { name: "Entry C" })
    end

    it "can drag/drop entry to sort" do
      visit "/backend/collections/amazing/entries"

      draggable = page.find("tbody#sortable tr:nth-child(3) .sortable-handle")
      droppable = page.find("tbody#sortable tr:nth-child(1)")

      draggable.drag_to(droppable)

      wait_for_ajax

      expect(page).to have_content("Sort order has been updated")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archangel-0.4.0 spec/features/backend/entries/listing_sorting_spec.rb