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/functional/groups_controller_test.rb | |
parent | d6009d77ffa221c14a4536be98a04e8e4b6474a9 (diff) |
pickup group permission model added
Diffstat (limited to 'test/functional/groups_controller_test.rb')
-rw-r--r-- | test/functional/groups_controller_test.rb | 49 |
1 files changed, 49 insertions, 0 deletions
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 |