Skip to content

Commit

Permalink
removed dead code, added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturG committed Mar 1, 2014
1 parent b4f74ac commit 0e3bb4e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
7 changes: 0 additions & 7 deletions app/controllers/application_controller.rb
@@ -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
4 changes: 0 additions & 4 deletions app/helpers/application_helper.rb
@@ -1,8 +1,4 @@
module ApplicationHelper module ApplicationHelper
def program_path program
"/users/#{program.author_username}/programs/#{program.slug}"
end

def markdown(text) def markdown(text)
Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(hard_wrap: true), autolink: true).render(text).html_safe Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(hard_wrap: true), autolink: true).render(text).html_safe
end end
Expand Down
20 changes: 20 additions & 0 deletions spec/models/deleted_user_spec.rb
@@ -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
2 changes: 0 additions & 2 deletions spec/unit/sluggifier_spec.rb
Expand Up @@ -22,6 +22,4 @@
end end
end end
end end


end end

0 comments on commit 0e3bb4e

Please sign in to comment.