spec/features/user_view_spec.rb in marty-3.0.1 vs spec/features/user_view_spec.rb in marty-3.1.0
- old
+ new
@@ -6,11 +6,11 @@
press('User Management')
expect(page).to have_content 'marty'
end
def go_to_user_view_backdoor
- sys_btn = first(:btn, 'System')
+ sys_btn = first(:btn, 'System') rescue nil
if sys_btn
sys_btn.click
expect(page).not_to have_content 'User Management'
end
@@ -145,27 +145,27 @@
go_to_user_view_backdoor
user_view = netzke_find('user_view')
by 'check buttons' do
user_view.select_row(1)
- err = /Unable to find visible btn/
- expect { find(:btn, 'New User') }.to raise_error(err)
- expect { find(:btn, 'Edit') }.to raise_error(err)
- expect { find(:btn, 'Delete') }.to raise_error(err)
+ err = /Unable to find btn/
+ ['New User', 'Edit', 'Delete'].each do |btn_name|
+ expect { find(:btn, btn_name) }.to raise_error(err)
+ end
end
end
it 'developer denied access' do
log_in_as('dev1')
go_to_user_view_backdoor
user_view = netzke_find('user_view')
by 'check buttons' do
user_view.select_row(1)
- err = /Unable to find visible btn/
- expect { find(:btn, 'New User') }.to raise_error(err)
- expect { find(:btn, 'Edit') }.to raise_error(err)
- expect { find(:btn, 'Delete') }.to raise_error(err)
+ err = /Unable to find btn/
+ ['New User', 'Edit', 'Delete'].each do |btn_name|
+ expect { find(:btn, btn_name) }.to raise_error(err)
+ end
end
end
end
end