diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-06-17 10:37:39 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-06-17 10:37:39 -0500 |
commit | 1c4d28ba314c8cdd0039becf3bc9e678219b8f46 (patch) | |
tree | 67a4b6db06cc9c26145de94f06f3fe8e1adf7953 /actionpack/test/template | |
parent | 85f2f34d5ec8ccdea4755740b810ac514d9f3dd9 (diff) | |
download | rails-1c4d28ba314c8cdd0039becf3bc9e678219b8f46.tar.gz rails-1c4d28ba314c8cdd0039becf3bc9e678219b8f46.tar.bz2 rails-1c4d28ba314c8cdd0039becf3bc9e678219b8f46.zip |
Move model naming into ActiveModel
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/atom_feed_helper_test.rb | 1 | ||||
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 3 | ||||
-rw-r--r-- | actionpack/test/template/record_tag_helper_test.rb | 1 | ||||
-rw-r--r-- | actionpack/test/template/test_test.rb | 1 | ||||
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 2 |
5 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionpack/test/template/atom_feed_helper_test.rb index bd97caf5d7..6f1179f359 100644 --- a/actionpack/test/template/atom_feed_helper_test.rb +++ b/actionpack/test/template/atom_feed_helper_test.rb @@ -1,6 +1,7 @@ require 'abstract_unit' Scroll = Struct.new(:id, :to_param, :title, :body, :updated_at, :created_at) +Scroll.extend ActiveModel::Naming class ScrollsController < ActionController::Base FEEDS = {} diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index f9f418aec9..02b1d137f5 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -1,8 +1,10 @@ require 'abstract_unit' Bunny = Struct.new(:Bunny, :id) +Bunny.extend ActiveModel::Naming class Author + extend ActiveModel::Naming attr_reader :id def save; @id = 1 end def new_record?; @id.nil? end @@ -12,6 +14,7 @@ class Author end class Article + extend ActiveModel::Naming attr_reader :id attr_reader :author_id def save; @id = 1; @author_id = 1 end diff --git a/actionpack/test/template/record_tag_helper_test.rb b/actionpack/test/template/record_tag_helper_test.rb index 809ed6d6af..5b840d123b 100644 --- a/actionpack/test/template/record_tag_helper_test.rb +++ b/actionpack/test/template/record_tag_helper_test.rb @@ -1,6 +1,7 @@ require 'abstract_unit' class Post + extend ActiveModel::Naming def id 45 end diff --git a/actionpack/test/template/test_test.rb b/actionpack/test/template/test_test.rb index dd07a6d438..f32d0b3d42 100644 --- a/actionpack/test/template/test_test.rb +++ b/actionpack/test/template/test_test.rb @@ -41,6 +41,7 @@ class PeopleHelperTest < ActionView::TestCase def test_link_to_person person = mock(:name => "David") + person.class.extend ActiveModel::Naming expects(:mocha_mock_path).with(person).returns("/people/1") assert_equal '<a href="/people/1">David</a>', link_to_person(person) end diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index f3d2f87b4a..f0364fd660 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -494,6 +494,7 @@ class LinkToUnlessCurrentWithControllerTest < ActionView::TestCase end class Workshop + extend ActiveModel::Naming attr_accessor :id, :new_record def initialize(id, new_record) @@ -510,6 +511,7 @@ class Workshop end class Session + extend ActiveModel::Naming attr_accessor :id, :workshop_id, :new_record def initialize(id, new_record) |