spec/features/user_view_spec.rb in marty-2.5.2 vs spec/features/user_view_spec.rb in marty-2.5.4
- old
+ new
@@ -1,9 +1,8 @@
require 'spec_helper'
feature 'under Sytem menu, User Management worflows', js: true do
-
def go_to_user_view
press('System')
press('User Management')
expect(page).to have_content 'marty'
end
@@ -13,11 +12,11 @@
if sys_btn
sys_btn.click
expect(page).not_to have_content 'User Management'
end
- ensure_on("/#userView")
+ ensure_on('/#userView')
end
# Checkbox Helpers
def check name, val = true
page.driver.browser.execute_script <<-JS
@@ -76,36 +75,35 @@
end
end
and_by 'check row got edited' do
wait_for_ajax
- expect(user_view.get_row_vals(2)).to netzke_include({
- :login=>"new_login",
- :firstname=>"new_fname",
- :lastname=>"new_lname",
- :active=>true,
- :roles=>"User Manager,Viewer",
- })
+ expect(user_view.get_row_vals(2)).to netzke_include(
+ :login => 'new_login',
+ :firstname => 'new_fname',
+ :lastname => 'new_lname',
+ :active => true,
+ :roles => 'User Manager,Viewer',
+ )
end
and_by 'delete user fails' do
user_view.select_row(2)
- press("Delete")
- press("Yes")
- expect(find(:msg)).to have_content("Users cannot be deleted - set " +
+ press('Delete')
+ press('Yes')
+ expect(find(:msg)).to have_content('Users cannot be deleted - set ' +
"'Active' to false to disable the " +
- "account")
+ 'account')
user_view.select_row(1)
- press("Delete")
- press("Yes")
- expect(find(:msg)).to have_content("You cannot delete your own account")
+ press('Delete')
+ press('Yes')
+ expect(find(:msg)).to have_content('You cannot delete your own account')
expect(user_view.row_count).to eq 2
end
end
describe 'check user permissions & what buttons appear' do
-
before(:all) do
populate_test_users
end
it 'user manager has access' do