Commit 3c441ac 1 parent 35ab7a5 commit 3c441ac Copy full SHA for 3c441ac
File tree 2 files changed +34
-1
lines changed
2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Feature: Subject Delete
9
9
And the user checks the checkbox of the Subject
10
10
And the user clicks on 'Delete'
11
11
And the user clicks on 'Delete Records'
12
- Then the 'Records ' deleted message is displayed
12
+ Then the 'Subjects ' deleted message is displayed
13
13
And the Subject is deleted
14
14
Scenario : Subject is deleted from the view page
15
15
Given the user is on the Subject view page
You can’t perform that action at this time.
0 commit comments