Change the i18n default name to :"unauthorized.default"

This commit is contained in:
Nicolás Hock Isaza 2011-07-01 13:10:20 -05:00
parent 71f60bc4ac
commit 1c3e61725f
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ module CanCan
@message = message @message = message
@action = action @action = action
@subject = subject @subject = subject
@default_message = I18n.t(:"cancan.default_message", :default => "You are not authorized to access this page.") @default_message = I18n.t(:"unauthorized.default", :default => "You are not authorized to access this page.")
end end
def to_s def to_s

View File

@ -39,7 +39,7 @@ describe CanCan::AccessDenied do
end end
it "uses i18n for the default message" do it "uses i18n for the default message" do
I18n.backend.store_translations :en, :cancan => {:default_message => "This is a different message"} I18n.backend.store_translations :en, :unauthorized => {:default => "This is a different message"}
@exception = CanCan::AccessDenied.new @exception = CanCan::AccessDenied.new
@exception.message.should == "This is a different message" @exception.message.should == "This is a different message"
end end