Commit 182969118ee7938f56db5d76725c8b687e33ebb9
1 parent
36c2effa
Exists in
master
and in
28 other branches
ActionItem756: retrived the terms of use for creating an account as activate a enterprise
Showing
3 changed files
with
15 additions
and
0 deletions
Show diff stats
app/controllers/public/account_controller.rb
app/models/user.rb
test/functional/account_controller_test.rb
... | ... | @@ -500,6 +500,19 @@ class AccountControllerTest < Test::Unit::TestCase |
500 | 500 | assert_template 'blocked' |
501 | 501 | end |
502 | 502 | |
503 | + should 'load terms of use for users when creating new users as activate enterprise' do | |
504 | + env = Environment.default | |
505 | + env.terms_of_use = 'some terms' | |
506 | + env.save! | |
507 | + ent = Enterprise.create!(:name => 'test enterprise', :identifier => 'test_ent', :foundation_year => 1998, :enabled => false) | |
508 | + task = EnterpriseActivation.create!(:enterprise => ent) | |
509 | + EnterpriseActivation.expects(:find_by_code).with('0123456789').returns(task).at_least_once | |
510 | + | |
511 | + post :activate_enterprise, :enterprise_code => '0123456789', :answer => '1998', :terms_accepted => true | |
512 | + | |
513 | + assert_equal 'some terms', assigns(:terms_of_use) | |
514 | + end | |
515 | + | |
503 | 516 | # end of enterprise activation tests |
504 | 517 | |
505 | 518 | should 'not be able to signup while inverse captcha field filled' do | ... | ... |