Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
20 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,14 +1,7 @@ | |||
class ApplicationController < ActionController::Base | class ApplicationController < ActionController::Base | ||
protect_from_forgery | protect_from_forgery | ||
helper_method :title | |||
|
|
||
def title t=nil | |||
@title = t unless t.blank? | |||
@title | |||
end | |||
|
|||
rescue_from CanCan::AccessDenied do |exception| | rescue_from CanCan::AccessDenied do |exception| | ||
redirect_to login_url, :alert => exception.message | redirect_to login_url, :alert => exception.message | ||
end | end | ||
|
|||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
require 'spec_helper' | |||
|
|||
describe DeletedUser do | |||
|
|||
before do | |||
@user = DeletedUser.new | |||
end | |||
|
|||
it 'has deleted username' do | |||
@user.username.should == 'Deleted User' | |||
end | |||
|
|||
it 'has no email' do | |||
@user.email.should == 'none' | |||
end | |||
|
|||
it 'returns deleted user param' do | |||
@user.to_param.should == 'deleted_user' | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -22,6 +22,4 @@ | ||
end | end | ||
end | end | ||
end | end | ||
|
|||
|
|||
end | end |