2014-02-17 15:37:04 +08:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class UsersControllerTest < ActionController::TestCase
|
2014-02-17 16:51:12 +08:00
|
|
|
fixtures :users, :user_extensions
|
2014-02-17 15:37:04 +08:00
|
|
|
def setup
|
|
|
|
initial_user_controller
|
|
|
|
end
|
|
|
|
def teardown
|
|
|
|
teardown_user_controller
|
|
|
|
end
|
|
|
|
|
|
|
|
test "test user valid" do
|
|
|
|
assert @user.valid?, "user valid."
|
|
|
|
end
|
|
|
|
|
|
|
|
test "get user_courses page" do
|
|
|
|
get :user_courses, {:id => @user.id}
|
|
|
|
assert_response :success
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def initial_user_controller
|
2014-02-17 16:51:12 +08:00
|
|
|
@user = users(:person_mao)
|
|
|
|
@user_yan = users(:person_one)
|
2014-02-17 15:37:04 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def teardown_user_controller
|
|
|
|
@user = nil
|
2014-02-17 16:51:12 +08:00
|
|
|
@user_yan = nil
|
2014-02-17 15:37:04 +08:00
|
|
|
end
|
|
|
|
end
|