Commit 888853b 1 parent 310c42a commit 888853b Copy full SHA for 888853b
File tree 2 files changed +30
-0
lines changed
staff_features/repositories
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,15 @@ def login_archivist
58
58
fill_in 'password' , with : "archivist-user-#{ uuid } "
59
59
60
60
click_on 'Sign In'
61
+
62
+ begin
63
+ element = find ( '.alert.alert-danger.with-hide-alert' )
64
+ if element . text == 'Login attempt failed'
65
+ raise "Login failed for user: archivist-user-#{ uuid } "
66
+ end
67
+ rescue Capybara ::ElementNotFound
68
+ # Pass on successful login
69
+ end
61
70
end
62
71
63
72
def ensure_test_repository_exists
Original file line number Diff line number Diff line change 3
3
Then 'the {string} option is not displayed in the dropdown menu' do |string |
4
4
expect ( page ) . to_not have_text string
5
5
end
6
+
7
+ Then 'the archivist user cannot manage repositories' do
8
+ visit "#{ STAFF_URL } /repositories"
9
+
10
+ expect ( find ( 'h2' ) . text ) . to eq 'Repositories'
11
+
12
+ rows = all ( '#tabledSearchResults tbody tr' )
13
+
14
+ expect ( rows . length > 0 ) . to eq true
15
+
16
+ within rows [ 0 ] do
17
+ click_on "View"
18
+ end
19
+
20
+ respository_id = current_url . split ( '/' ) . pop
21
+ visit "#{ STAFF_URL } /repositories/#{ respository_id } /edit"
22
+ expect ( page ) . to have_text 'Unable to Access Page'
23
+
24
+ visit "#{ STAFF_URL } /repositories/new"
25
+ expect ( page ) . to have_text 'Unable to Access Page'
26
+ end
You can’t perform that action at this time.
0 commit comments