Sha256: 06e3e8bd6423136d819573726f6b7d98af545194310def2a8e7235a5080f85b3

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

require "rails_helper"

RSpec.describe "Backend - Widgets (HTML)", type: :feature do
  describe "deletion" do
    before do
      stub_authorization!

      create(:widget, name: "Delete Me")
      create(:widget, name: "Not Deleted Widget")
    end

    it "confirms the Widget is no longer accessible" do
      visit "/backend/widgets"

      within("tbody tr:eq(1)") { click_on "Destroy" }

      expect(page).to have_content("Widget was successfully destroyed.")
    end

    it "confirms the deleted Widget is no longer listed" do
      visit "/backend/widgets"

      within("tbody tr:eq(1)") { click_on "Destroy" }

      within("tbody tr:eq(1)") do
        expect(page).not_to have_content("Delete Me")
      end
    end

    it "confirms the first available Widget is correct" do
      visit "/backend/widgets"

      within("tbody tr:eq(1)") { click_on "Destroy" }

      within("tbody tr:eq(1)") do
        expect(page).to have_content("Not Deleted Widget")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archangel-0.4.0 spec/features/backend/widgets/delete_spec.rb