Skip to content

Commit 3c441ac

Browse files
Subject delete
1 parent 35ab7a5 commit 3c441ac

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# frozen_string_literal: true
2+
3+
When 'the user checks the checkbox of the Subject' do
4+
find('#multiselect-item').check
5+
row = find('tr.selected')
6+
input = row.find('input')
7+
expect(input.value).to include 'subjects'
8+
9+
@subject_id = input.value.split('/').pop
10+
end
11+
12+
Then 'the Subject is deleted' do
13+
expect(@subject_id).to_not eq nil
14+
15+
visit "#{STAFF_URL}/subjects/#{@subject_id}/edit"
16+
17+
expect(find('h2').text).to eq 'Record Not Found'
18+
19+
expected_text = "The record you've tried to access may no longer exist or you may not have permission to view it."
20+
expect(page).to have_text expected_text
21+
end
22+
23+
Given('the user is on the Subject view page') do
24+
visit "#{STAFF_URL}/subjects/#{@subject_id}"
25+
end
26+
27+
Then 'the user is still on the Subject view page' do
28+
expect(find('h2').text).to eq "subject_term_#{@uuid} Subject"
29+
end
30+
31+
Then 'the Subjects page is displayed' do
32+
expect(find('h2').text).to have_text 'Subjects'
33+
end

staff_features/subjects/subject_delete.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Feature: Subject Delete
99
And the user checks the checkbox of the Subject
1010
And the user clicks on 'Delete'
1111
And the user clicks on 'Delete Records'
12-
Then the 'Records' deleted message is displayed
12+
Then the 'Subjects' deleted message is displayed
1313
And the Subject is deleted
1414
Scenario: Subject is deleted from the view page
1515
Given the user is on the Subject view page

0 commit comments

Comments
 (0)