ref: refs/heads/master
commit d40337e87bc75b7c7f0f1c756975b0a2a4f746bb
Author: Stefan Schubert
Date: Fri Aug 14 10:16:37 2009 +0200
added write testcase
---
.../test/functional/permission_controller_test.rb | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/plugins/permissions/test/functional/permission_controller_test.rb b/plugins/permissions/test/functional/permission_controller_test.rb
index 8de37a5..7454726 100644
--- a/plugins/permissions/test/functional/permission_controller_test.rb
+++ b/plugins/permissions/test/functional/permission_controller_test.rb
@@ -17,10 +17,13 @@ class PermissionsControllerTest < ActionController::TestCase
end
class Permission
- attr_accessor :name, :grant
+ attr_accessor :name, :grant, :id
def initialize (name, grant)
@grant = grant
@name = name
+ @id = 0
+ end
+ def save
end
end
@@ -122,9 +125,7 @@ class PermissionsControllerTest < ActionController::TestCase
];
end
- def save
- @saved = true
- end
+
end
def setup
@@ -133,8 +134,6 @@ class PermissionsControllerTest < ActionController::TestCase
@request = ActionController::TestRequest.new
# http://railsforum.com/viewtopic.php?id=1719
@request.session[:account_id] = 1 # defined in fixtures
- @right_set_permissions = true
- @right_get_permissions = true
@result = Result.new
@result.fill
@proxy = Proxy.new
@@ -143,19 +142,24 @@ class PermissionsControllerTest < ActionController::TestCase
PermissionsController.any_instance.stubs(:client_permissions).with().returns(@proxy)
end
- def test_access_index
+ def test_permission_index
get :index
#check if everything is correctly setted
assert_response :success
end
- def test_access_search
+ def test_permission_search
get :search, {:user =>"test" }
#check if everything is correctly setted
assert_response :success
end
+ def test_permission_set
+ post :set, { "org.opensuse.yast.patch.install"=>"revoke", :user =>"test" }
+
+ assert_response :success
+ end
end
\ No newline at end of file
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org