Commit f3a7648d3946f25d0fc69b55404de5d5ea27470b
1 parent
7dcab529
Exists in
staging
and in
42 other branches
ActionItem152: logging in and out with popups
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1212 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
26 additions
and
0 deletions
Show diff stats
app/controllers/public/account_controller.rb
| ... | ... | @@ -26,6 +26,14 @@ class AccountController < PublicController |
| 26 | 26 | end |
| 27 | 27 | end |
| 28 | 28 | |
| 29 | + def logout_popup | |
| 30 | + render :action => 'logout_popup', :layout => false | |
| 31 | + end | |
| 32 | + | |
| 33 | + def login_popup | |
| 34 | + render :action => 'login', :layout => false | |
| 35 | + end | |
| 36 | + | |
| 29 | 37 | # action to register an user to the application |
| 30 | 38 | def signup |
| 31 | 39 | begin | ... | ... |
test/functional/account_controller_test.rb
| ... | ... | @@ -234,6 +234,18 @@ class AccountControllerTest < Test::Unit::TestCase |
| 234 | 234 | assert !User.find(user.id).authenticated?('onepass') |
| 235 | 235 | end |
| 236 | 236 | |
| 237 | + should 'display login popup' do | |
| 238 | + get :login_popup | |
| 239 | + assert_template 'login' | |
| 240 | + assert_no_tag :tag => "body" # e.g. no layout | |
| 241 | + end | |
| 242 | + | |
| 243 | + should 'display logout popup' do | |
| 244 | + get :logout_popup | |
| 245 | + assert_template 'logout_popup' | |
| 246 | + assert_no_tag :tag => "body" # e.g. no layout | |
| 247 | + end | |
| 248 | + | |
| 237 | 249 | protected |
| 238 | 250 | def create_user(options = {}) |
| 239 | 251 | post :signup, :user => { :login => 'quire', :email => 'quire@example.com', | ... | ... |