Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Commit 98f8cf8

Browse files
Event delete
1 parent b5fb8de commit 98f8cf8

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

staff_features/events/event_delete.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Feature: Event Delete
1515
And the user clicks on 'Cancel'
1616
Then the user is still on the Event view page
1717
Scenario: Event is deleted from the edit page
18-
Given the user is on the Event edit page
18+
Given the Event edit page is displayed
1919
When the user clicks on 'Delete'
2020
And the user clicks on 'Delete' in the modal
2121
Then the Events page is displayed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# frozen_string_literal: true
2+
3+
Given 'the user is on the Event view page' do
4+
visit "#{STAFF_URL}/events/#{@event_id}"
5+
end
6+
7+
Then 'the Events page is displayed' do
8+
expect(current_url).to include "#{STAFF_URL}/events"
9+
end
10+
11+
Then 'the Event is deleted' do
12+
visit "#{STAFF_URL}/events/#{@event_id}/edit"
13+
14+
expect(find('h2').text).to eq 'Record Not Found'
15+
16+
expected_text = "The record you've tried to access may no longer exist or you may not have permission to view it."
17+
expect(page).to have_text expected_text
18+
end
19+
20+
Then 'the user is still on the Event view page' do
21+
expect(current_url).to eq "#{STAFF_URL}/events/#{@event_id}"
22+
end
23+
24+
Given 'the user is on the Event edit page' do
25+
expect(current_url).to eq "#{STAFF_URL}/events/#{@event_id}/edit"
26+
end
27+
28+
Given 'the Event edit page is displayed' do
29+
visit "#{STAFF_URL}/events/#{@event_id}/edit"
30+
end

0 commit comments

Comments
 (0)