Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Added i18n for facebook logout
Browse files Browse the repository at this point in the history
  • Loading branch information
nbibler committed Mar 4, 2010
1 parent 554164b commit e260edd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
8 changes: 0 additions & 8 deletions app/controllers/blue_light_special/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def new
def create
@user = ::User.new params[:user]
if @user.save
flash_notice_after_create
redirect_to(url_after_create)
else
render :template => 'users/new'
Expand All @@ -22,13 +21,6 @@ def create

private

def flash_notice_after_create
flash[:notice] = translate(:deliver_confirmation,
:scope => [:blue_light_special, :controllers, :users],
:default => "You will receive an email within the next few minutes. " <<
"It contains instructions for confirming your account.")
end

def url_after_create
sign_in_url
end
Expand Down
8 changes: 4 additions & 4 deletions lib/blue_light_special/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ def impersonating?

##
# Sets up the facebook session if the logged-in user is from facebook
#--
# FIXME: Use i18n interface for flash.
#++
#
def find_facebook_session
set_facebook_session
if facebook_session
Expand All @@ -147,7 +145,9 @@ def find_facebook_session
facebook_sign_out
end
rescue Facebooker::Session::SessionExpired
flash.now[:error] = "You have logged out of Facebook"
flash.now[:error] = translate(:facebook_log_out,
:scope => [:blue_light_special, :authentication],
:default => "You have logged out of Facebook")
facebook_sign_out
rescue NoMethodError
facebook_sign_out
Expand Down
8 changes: 0 additions & 8 deletions test/controllers/users_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ class UsersControllerTest < ActionController::TestCase

should_assign_to :user
should_change 'User.count', :by => 1

should "send the confirmation email" do
assert_sent_email do |email|
email.subject =~ /account confirmation/i
end
end

should_set_the_flash_to /confirm/i
should_redirect_to_url_after_create
end
end
Expand Down
2 changes: 2 additions & 0 deletions test/rails_root/config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
en:
blue_light_special:
authentication:
facebook_log_out: Bye bye Facebook
models:
blue_light_special_mailer:
change_password: Change your password
Expand Down

0 comments on commit e260edd

Please sign in to comment.