1 require File.dirname(__FILE__) + '/../test_helper'
3 class UserControllerTest < ActionController::TestCase
6 # The user creation page loads
9 assert_response :success
11 assert_select "html:root", :count => 1 do
12 assert_select "head", :count => 1 do
13 assert_select "title", :text => /create account/, :count => 1
15 assert_select "body", :count => 1 do
16 assert_select "div#content", :count => 1 do
17 assert_select "form[action='/user/save'][method=post]", :count => 1 do
18 assert_select "input[id=user_email]", :count => 1
19 assert_select "input[id=user_email_confirmation]", :count => 1
20 assert_select "input[id=user_display_name]", :count => 1
21 assert_select "input[id=user_pass_crypt][type=password]", :count => 1
22 assert_select "input[id=user_pass_crypt_confirmation][type=password]", :count => 1
23 assert_select "input[type=submit][value=Signup]", :count => 1
30 # Check that the user account page will display and contains some relevant
31 # information for the user
32 def test_view_user_account
34 assert_response :not_found
36 get :view, {:display_name => "test"}
37 assert_response :success
40 def test_user_api_details
42 assert_response :unauthorized
44 basic_authorization(users(:normal_user).email, "test")
46 assert_response :success