diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-01 18:01:34 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-01 18:01:34 -0700 |
commit | 44f85678e967f1eccfaf448f82ca81111c9584af (patch) | |
tree | 5ddbb2a04997a1f2e168a6f61b910239943a226b | |
parent | 6e1df2ca4631b8da6dae348af9d791f6e9aee1c5 (diff) | |
download | rails-44f85678e967f1eccfaf448f82ca81111c9584af.tar.gz rails-44f85678e967f1eccfaf448f82ca81111c9584af.tar.bz2 rails-44f85678e967f1eccfaf448f82ca81111c9584af.zip |
delete repeated code
-rw-r--r-- | actionpack/test/abstract_unit.rb | 18 | ||||
-rw-r--r-- | actionpack/test/controller/redirect_test.rb | 18 | ||||
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 18 |
3 files changed, 18 insertions, 36 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 3540af13ac..bf6d43da08 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -308,3 +308,21 @@ module ActionView end end end + +class Workshop + extend ActiveModel::Naming + include ActiveModel::Conversion + attr_accessor :id + + def initialize(id) + @id = id + end + + def persisted? + id.present? + end + + def to_s + id.to_s + end +end diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb index b00142c92d..92d4a6d98b 100644 --- a/actionpack/test/controller/redirect_test.rb +++ b/actionpack/test/controller/redirect_test.rb @@ -3,24 +3,6 @@ require 'abstract_unit' class WorkshopsController < ActionController::Base end -class Workshop - extend ActiveModel::Naming - include ActiveModel::Conversion - attr_accessor :id - - def initialize(id) - @id = id - end - - def persisted? - id.present? - end - - def to_s - id.to_s - end -end - class RedirectController < ActionController::Base def simple_redirect redirect_to :action => "hello_world" diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index db8fd82aeb..98276da559 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -547,24 +547,6 @@ class LinkToUnlessCurrentWithControllerTest < ActionController::TestCase end end -class Workshop - extend ActiveModel::Naming - include ActiveModel::Conversion - attr_accessor :id - - def initialize(id) - @id = id - end - - def persisted? - id.present? - end - - def to_s - id.to_s - end -end - class Session extend ActiveModel::Naming include ActiveModel::Conversion |