Skip to content

Commit 0e3bb4e

Browse files
committed
removed dead code, added more tests
1 parent b4f74ac commit 0e3bb4e

4 files changed

Lines changed: 20 additions & 13 deletions

File tree

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
class ApplicationController < ActionController::Base
22
protect_from_forgery
3-
helper_method :title
43

5-
def title t=nil
6-
@title = t unless t.blank?
7-
@title
8-
end
9-
104
rescue_from CanCan::AccessDenied do |exception|
115
redirect_to login_url, :alert => exception.message
126
end
13-
147
end

app/helpers/application_helper.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
module ApplicationHelper
2-
def program_path program
3-
"/users/#{program.author_username}/programs/#{program.slug}"
4-
end
5-
62
def markdown(text)
73
Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(hard_wrap: true), autolink: true).render(text).html_safe
84
end

spec/models/deleted_user_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require 'spec_helper'
2+
3+
describe DeletedUser do
4+
5+
before do
6+
@user = DeletedUser.new
7+
end
8+
9+
it 'has deleted username' do
10+
@user.username.should == 'Deleted User'
11+
end
12+
13+
it 'has no email' do
14+
@user.email.should == 'none'
15+
end
16+
17+
it 'returns deleted user param' do
18+
@user.to_param.should == 'deleted_user'
19+
end
20+
end

spec/unit/sluggifier_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,4 @@
2222
end
2323
end
2424
end
25-
26-
2725
end

0 commit comments

Comments
 (0)