ref: refs/heads/master commit 6cd142825e2ef2393bb9d11bf7735817248bf14e Author: Klaus Kämpf <kkaempf@suse.de> Date: Tue Jul 7 17:05:32 2009 +0200 Bump coverage --- webservice/test/functional/yast_roles_test.rb | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/webservice/test/functional/yast_roles_test.rb b/webservice/test/functional/yast_roles_test.rb index 5b08275..34a52da 100644 --- a/webservice/test/functional/yast_roles_test.rb +++ b/webservice/test/functional/yast_roles_test.rb @@ -11,8 +11,6 @@ end class YastRolesTest < ActiveSupport::TestCase include YastRoles - session = Hash.new - attr_reader :current_account def setup @@ -21,8 +19,10 @@ class YastRolesTest < ActiveSupport::TestCase end def test_permission_check_trivial + save = ENV["RAILS_ENV"] ENV["RAILS_ENV"] = "test" assert permission_check(nil) + ENV["RAILS_ENV"] = save end def test_permission_check_no_account @@ -37,4 +37,20 @@ class YastRolesTest < ActiveSupport::TestCase def test_action_dummy assert !permission_check("dummy") end + + def test_polkit_override + def PolKit.polkit_check(action,login) return :yes if action == "test_polkit_override" end + assert permission_check("test_polkit_override") + end + + def test_role_ok + def PolKit.polkit_check(action,login) return :yes if login == "network_admin" end + assert permission_check("dummy") + end + + def test_role_not_ok + @current_account = CurrentLogin.new "nobody" + def PolKit.polkit_check(action,login) return :yes if login == "network_admin" end + assert !permission_check("dummy") + end end -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org