diff --git a/test/integration/signup_test.rb b/test/integration/signup_test.rb new file mode 100644 index 0000000..1950ac7 --- /dev/null +++ b/test/integration/signup_test.rb @@ -0,0 +1,29 @@ +require "#{File.dirname(__FILE__)}/../test_helper" + +class AccountTest < ActionController::IntegrationTest + fixtures :users, :profiles, :domains, :virtual_communities + + def test_should_require_acceptance_of_terms_for_signup + VirtualCommunity.default.update_attributes(:terms_of_use => 'You agree that from now on your soul belongs to us.') + + count = User.count + + get '/account/signup' + assert_response :success + assert_tag :tag => 'input', :attributes => { :name => 'user[terms_accepted]' } + + post '/account/signup', :user => { :login => 'shouldaccepterms', :password => 'test', :password_confirmation => 'test', :email => 'shouldaccepterms@example.com' } + assert_response :success + assert_template 'signup' + assert_equal count, User.count + + post '/account/signup', :user => { :login => 'shouldaccepterms', :password => 'test', :password_confirmation => 'test', :email => 'shouldaccepterms@example.com', :terms_accepted => '1' } + assert_response :redirect + + follow_redirect! + assert_response :success + assert_equal count + 1, User.count + + end + +end -- libgit2 0.21.2