From 7ca80880a8d488fe3f3b0f92fe22875dd1dca758 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 9 Aug 2011 21:43:23 -0400 Subject: [PATCH] adding the user controller for futzing with login bits --- .../app/controllers/user_controller.rb | 14 +++++++++++ .../015/hodgepodge/app/helpers/user_helper.rb | 2 ++ .../hodgepodge/app/views/user/login.html.erb | 2 ++ .../hodgepodge/app/views/user/logout.html.erb | 2 ++ .../app/views/user/my_account.html.erb | 2 ++ .../app/views/user/process_login.html.erb | 2 ++ cookbook/015/hodgepodge/config/routes.rb | 8 +++++++ .../test/functional/user_controller_test.rb | 24 +++++++++++++++++++ .../test/unit/helpers/user_helper_test.rb | 4 ++++ 9 files changed, 60 insertions(+) create mode 100644 cookbook/015/hodgepodge/app/controllers/user_controller.rb create mode 100644 cookbook/015/hodgepodge/app/helpers/user_helper.rb create mode 100644 cookbook/015/hodgepodge/app/views/user/login.html.erb create mode 100644 cookbook/015/hodgepodge/app/views/user/logout.html.erb create mode 100644 cookbook/015/hodgepodge/app/views/user/my_account.html.erb create mode 100644 cookbook/015/hodgepodge/app/views/user/process_login.html.erb create mode 100644 cookbook/015/hodgepodge/test/functional/user_controller_test.rb create mode 100644 cookbook/015/hodgepodge/test/unit/helpers/user_helper_test.rb diff --git a/cookbook/015/hodgepodge/app/controllers/user_controller.rb b/cookbook/015/hodgepodge/app/controllers/user_controller.rb new file mode 100644 index 0000000..af17834 --- /dev/null +++ b/cookbook/015/hodgepodge/app/controllers/user_controller.rb @@ -0,0 +1,14 @@ +class UserController < ApplicationController + def login + end + + def process_login + end + + def logout + end + + def my_account + end + +end diff --git a/cookbook/015/hodgepodge/app/helpers/user_helper.rb b/cookbook/015/hodgepodge/app/helpers/user_helper.rb new file mode 100644 index 0000000..0147c3f --- /dev/null +++ b/cookbook/015/hodgepodge/app/helpers/user_helper.rb @@ -0,0 +1,2 @@ +module UserHelper +end diff --git a/cookbook/015/hodgepodge/app/views/user/login.html.erb b/cookbook/015/hodgepodge/app/views/user/login.html.erb new file mode 100644 index 0000000..125c92a --- /dev/null +++ b/cookbook/015/hodgepodge/app/views/user/login.html.erb @@ -0,0 +1,2 @@ +

User#login

+

Find me in app/views/user/login.html.erb

diff --git a/cookbook/015/hodgepodge/app/views/user/logout.html.erb b/cookbook/015/hodgepodge/app/views/user/logout.html.erb new file mode 100644 index 0000000..50d0aac --- /dev/null +++ b/cookbook/015/hodgepodge/app/views/user/logout.html.erb @@ -0,0 +1,2 @@ +

User#logout

+

Find me in app/views/user/logout.html.erb

diff --git a/cookbook/015/hodgepodge/app/views/user/my_account.html.erb b/cookbook/015/hodgepodge/app/views/user/my_account.html.erb new file mode 100644 index 0000000..1bd6ef4 --- /dev/null +++ b/cookbook/015/hodgepodge/app/views/user/my_account.html.erb @@ -0,0 +1,2 @@ +

User#my_account

+

Find me in app/views/user/my_account.html.erb

diff --git a/cookbook/015/hodgepodge/app/views/user/process_login.html.erb b/cookbook/015/hodgepodge/app/views/user/process_login.html.erb new file mode 100644 index 0000000..2042592 --- /dev/null +++ b/cookbook/015/hodgepodge/app/views/user/process_login.html.erb @@ -0,0 +1,2 @@ +

User#process_login

+

Find me in app/views/user/process_login.html.erb

diff --git a/cookbook/015/hodgepodge/config/routes.rb b/cookbook/015/hodgepodge/config/routes.rb index e16dc87..82591b4 100644 --- a/cookbook/015/hodgepodge/config/routes.rb +++ b/cookbook/015/hodgepodge/config/routes.rb @@ -1,4 +1,12 @@ Hodgepodge::Application.routes.draw do + get "user/login" + + get "user/process_login" + + get "user/logout" + + get "user/my_account" + get "people/list" get "foo/pretty" diff --git a/cookbook/015/hodgepodge/test/functional/user_controller_test.rb b/cookbook/015/hodgepodge/test/functional/user_controller_test.rb new file mode 100644 index 0000000..b5da1f3 --- /dev/null +++ b/cookbook/015/hodgepodge/test/functional/user_controller_test.rb @@ -0,0 +1,24 @@ +require 'test_helper' + +class UserControllerTest < ActionController::TestCase + test "should get login" do + get :login + assert_response :success + end + + test "should get process_login" do + get :process_login + assert_response :success + end + + test "should get logout" do + get :logout + assert_response :success + end + + test "should get my_account" do + get :my_account + assert_response :success + end + +end diff --git a/cookbook/015/hodgepodge/test/unit/helpers/user_helper_test.rb b/cookbook/015/hodgepodge/test/unit/helpers/user_helper_test.rb new file mode 100644 index 0000000..ad44a53 --- /dev/null +++ b/cookbook/015/hodgepodge/test/unit/helpers/user_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class UserHelperTest < ActionView::TestCase +end