Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container Profile delete #106

Draft
wants to merge 2 commits into
base: container_profile_view
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions staff_features/container_profiles/container_profile_delete.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Feature: Container Profile Delete
Background:
Given an administrator user is logged in
And a Container Profile has been created
Scenario: Container Profile is deleted from the search results
When the user clicks on 'Browse'
And the user clicks on 'Container Profiles'
And the user filters by text with the Container Profile name
And the user checks the checkbox of the Container Profile
And the user clicks on 'Delete'
And the user clicks on 'Delete Records'
Then the Container Profile is deleted
Scenario: Container Profile is deleted from the view page
Given the user is on the Container Profile view page
When the user clicks on 'Delete'
And the user clicks on 'Delete' in the modal
Then the Container Profiles page is displayed
And the Container Profile is deleted
Scenario: Cancel Container Profile delete from the view page
Given the user is on the Container Profile view page
When the user clicks on 'Delete'
And the user clicks on 'Cancel'
Then the user is still on the Container Profile view page
Scenario: Container Profile is deleted from the edit page
Given the user is on the Container Profile edit page
When the user clicks on 'Delete'
And the user clicks on 'Delete' in the modal
Then the Container Profiles page is displayed
And the Container Profile is deleted
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

When 'the user checks the checkbox of the Container Profile' do
find('#multiselect-item').check
end

Then 'the Container Profile is deleted' do
visit "#{STAFF_URL}/container_profiles/#{@container_profile_id}/edit"

expect(find('h2').text).to eq 'Record Not Found'
expected_text = "The record you've tried to access may no longer exist or you may not have permission to view it."
expect(page).to have_text expected_text
end

Given 'the user is on the Container Profile view page' do
visit "#{STAFF_URL}/container_profiles/#{@container_profile_id}"
end

Then 'the Container Profiles page is displayed' do
expect(current_url).to include "#{STAFF_URL}/container_profiles"
end

Then 'the user is still on the Container Profile view page' do
expect(current_url).to eq "#{STAFF_URL}/container_profiles/#{@container_profile_id}"
end

Given 'the user is on the Container Profile edit page' do
visit "#{STAFF_URL}/container_profiles/#{@container_profile_id}/edit"
end
Loading