Commit 7a1cfb2 1 parent 4d828b9 commit 7a1cfb2 Copy full SHA for 7a1cfb2
File tree 2 files changed +36
-1
lines changed
2 files changed +36
-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
+ page . refresh
5
+
6
+ find ( '#multiselect-item' ) . check
7
+ row = find ( 'tr.selected' )
8
+ input = row . find ( 'input' )
9
+ expect ( input . value ) . to include 'subjects'
10
+
11
+ @subject_id = input . value . split ( '/' ) . pop
12
+ end
13
+
14
+ Then 'the Subject is deleted' do
15
+ expect ( @subject_id ) . to_not eq nil
16
+
17
+ visit "#{ STAFF_URL } /subjects/#{ @subject_id } /edit"
18
+
19
+ expect ( find ( 'h2' ) . text ) . to eq 'Record Not Found'
20
+
21
+ expected_text = "The record you've tried to access may no longer exist or you may not have permission to view it."
22
+ expect ( page ) . to have_text expected_text
23
+ end
24
+
25
+ Given ( 'the user is on the Subject view page' ) do
26
+ visit "#{ STAFF_URL } /subjects/#{ @subject_id } "
27
+ end
28
+
29
+ Then 'the user is still on the Subject view page' do
30
+ expect ( find ( 'h2' ) . text ) . to eq "subject_term_#{ @uuid } Subject"
31
+ end
32
+
33
+ Then 'the Subjects page is displayed' do
34
+ expect ( find ( 'h2' ) . text ) . to have_text 'Subjects'
35
+ 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