diff options
author | Peter Kozak <spag@golwen.net> | 2013-02-22 07:08:23 -0500 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-02-22 07:08:23 -0500 |
commit | 2a9b798f9e122582abb36605a7d4a1da0e70eca9 (patch) | |
tree | 45fe362d677cb243fba57dc7c0c23d01e653863e /test | |
parent | d6009d77ffa221c14a4536be98a04e8e4b6474a9 (diff) |
pickup group permission model added
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/group_memberships_controller_test.rb | 49 | ||||
-rw-r--r-- | test/functional/group_permissions_controller_test.rb | 49 | ||||
-rw-r--r-- | test/functional/groups_controller_test.rb | 49 | ||||
-rw-r--r-- | test/unit/group_membership_test.rb | 7 | ||||
-rw-r--r-- | test/unit/group_permission_test.rb | 7 | ||||
-rw-r--r-- | test/unit/group_test.rb | 7 |
6 files changed, 168 insertions, 0 deletions
diff --git a/test/functional/group_memberships_controller_test.rb b/test/functional/group_memberships_controller_test.rb new file mode 100644 index 0000000..596de1f --- /dev/null +++ b/test/functional/group_memberships_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class GroupMembershipsControllerTest < ActionController::TestCase + setup do + @group_membership = group_memberships(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:group_memberships) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create group_membership" do + assert_difference('GroupMembership.count') do + post :create, group_membership: @group_membership.attributes + end + + assert_redirected_to group_membership_path(assigns(:group_membership)) + end + + test "should show group_membership" do + get :show, id: @group_membership.to_param + assert_response :success + end + + test "should get edit" do + get :edit, id: @group_membership.to_param + assert_response :success + end + + test "should update group_membership" do + put :update, id: @group_membership.to_param, group_membership: @group_membership.attributes + assert_redirected_to group_membership_path(assigns(:group_membership)) + end + + test "should destroy group_membership" do + assert_difference('GroupMembership.count', -1) do + delete :destroy, id: @group_membership.to_param + end + + assert_redirected_to group_memberships_path + end +end diff --git a/test/functional/group_permissions_controller_test.rb b/test/functional/group_permissions_controller_test.rb new file mode 100644 index 0000000..4b70ae3 --- /dev/null +++ b/test/functional/group_permissions_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class GroupPermissionsControllerTest < ActionController::TestCase + setup do + @group_permission = group_permissions(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:group_permissions) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create group_permission" do + assert_difference('GroupPermission.count') do + post :create, group_permission: @group_permission.attributes + end + + assert_redirected_to group_permission_path(assigns(:group_permission)) + end + + test "should show group_permission" do + get :show, id: @group_permission.to_param + assert_response :success + end + + test "should get edit" do + get :edit, id: @group_permission.to_param + assert_response :success + end + + test "should update group_permission" do + put :update, id: @group_permission.to_param, group_permission: @group_permission.attributes + assert_redirected_to group_permission_path(assigns(:group_permission)) + end + + test "should destroy group_permission" do + assert_difference('GroupPermission.count', -1) do + delete :destroy, id: @group_permission.to_param + end + + assert_redirected_to group_permissions_path + end +end diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb new file mode 100644 index 0000000..2981018 --- /dev/null +++ b/test/functional/groups_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class GroupsControllerTest < ActionController::TestCase + setup do + @group = groups(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:groups) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create group" do + assert_difference('Group.count') do + post :create, group: @group.attributes + end + + assert_redirected_to group_path(assigns(:group)) + end + + test "should show group" do + get :show, id: @group.to_param + assert_response :success + end + + test "should get edit" do + get :edit, id: @group.to_param + assert_response :success + end + + test "should update group" do + put :update, id: @group.to_param, group: @group.attributes + assert_redirected_to group_path(assigns(:group)) + end + + test "should destroy group" do + assert_difference('Group.count', -1) do + delete :destroy, id: @group.to_param + end + + assert_redirected_to groups_path + end +end diff --git a/test/unit/group_membership_test.rb b/test/unit/group_membership_test.rb new file mode 100644 index 0000000..3719323 --- /dev/null +++ b/test/unit/group_membership_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GroupMembershipTest < ActiveSupport::TestCase + def test_should_be_valid + assert GroupMembership.new.valid? + end +end diff --git a/test/unit/group_permission_test.rb b/test/unit/group_permission_test.rb new file mode 100644 index 0000000..44e0b28 --- /dev/null +++ b/test/unit/group_permission_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GroupPermissionTest < ActiveSupport::TestCase + def test_should_be_valid + assert GroupPermission.new.valid? + end +end diff --git a/test/unit/group_test.rb b/test/unit/group_test.rb new file mode 100644 index 0000000..68ecdc0 --- /dev/null +++ b/test/unit/group_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GroupTest < ActiveSupport::TestCase + def test_should_be_valid + assert Group.new.valid? + end +end |