public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/simonjefford/rails.git
Search Repo:
Set precompiled fixture load path constant to speed up tests
josh (author)
Wed Jun 25 13:24:12 -0700 2008
commit  339491a6b37722497ebafe9998e17507f47e8fd6
tree    96e7dc63607054c6e3ce6f08e41a9e96d8a44ea5
parent  a9259ccfe05690dc4cb7993d551603c39619c27f
...
22
23
24
 
25
26
27
...
22
23
24
25
26
27
28
0
@@ -22,6 +22,7 @@ ActiveSupport::Deprecation.debug = true
0
 ActionController::Base.logger = nil
0
 ActionController::Routing::Routes.reload rescue nil
0
 
0
+FIXTURE_LOAD_PATH = ActionView::ViewLoadPaths::LoadPath.new(File.join(File.dirname(__FILE__), 'fixtures'))
0
 
0
 # Wrap tests that use Mocha and skip if unavailable.
0
 def uses_mocha(test_name)
...
30
31
32
33
34
35
36
...
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
67
68
69
70
71
72
73
74
75
76
77
 
 
 
 
 
78
79
80
81
82
83
 
 
 
84
85
86
87
88
89
90
 
91
92
93
...
30
31
32
 
33
34
35
...
47
48
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 
 
 
 
70
 
71
 
 
 
 
72
73
74
75
76
77
 
78
 
 
 
79
80
81
82
83
84
85
86
87
 
88
89
90
91
0
@@ -30,7 +30,6 @@ end
0
 $stderr.flush
0
 
0
 
0
-
0
 # Define the rest of the connector
0
 class ActiveRecordTestConnector
0
   class << self
0
@@ -48,46 +47,45 @@ class ActiveRecordTestConnector
0
     end
0
 
0
     private
0
-
0
- def setup_connection
0
- if Object.const_defined?(:ActiveRecord)
0
- defaults = { :database => ':memory:' }
0
- begin
0
- options = defaults.merge :adapter => 'sqlite3', :timeout => 500
0
- ActiveRecord::Base.establish_connection(options)
0
- ActiveRecord::Base.configurations = { 'sqlite3_ar_integration' => options }
0
- ActiveRecord::Base.connection
0
- rescue Exception # errors from establishing a connection
0
- $stderr.puts 'SQLite 3 unavailable; trying SQLite 2.'
0
- options = defaults.merge :adapter => 'sqlite'
0
- ActiveRecord::Base.establish_connection(options)
0
- ActiveRecord::Base.configurations = { 'sqlite2_ar_integration' => options }
0
- ActiveRecord::Base.connection
0
+ def setup_connection
0
+ if Object.const_defined?(:ActiveRecord)
0
+ defaults = { :database => ':memory:' }
0
+ begin
0
+ options = defaults.merge :adapter => 'sqlite3', :timeout => 500
0
+ ActiveRecord::Base.establish_connection(options)
0
+ ActiveRecord::Base.configurations = { 'sqlite3_ar_integration' => options }
0
+ ActiveRecord::Base.connection
0
+ rescue Exception # errors from establishing a connection
0
+ $stderr.puts 'SQLite 3 unavailable; trying SQLite 2.'
0
+ options = defaults.merge :adapter => 'sqlite'
0
+ ActiveRecord::Base.establish_connection(options)
0
+ ActiveRecord::Base.configurations = { 'sqlite2_ar_integration' => options }
0
+ ActiveRecord::Base.connection
0
+ end
0
+
0
+ Object.send(:const_set, :QUOTED_TYPE, ActiveRecord::Base.connection.quote_column_name('type')) unless Object.const_defined?(:QUOTED_TYPE)
0
+ else
0
+ raise "Can't setup connection since ActiveRecord isn't loaded."
0
         end
0
-
0
- Object.send(:const_set, :QUOTED_TYPE, ActiveRecord::Base.connection.quote_column_name('type')) unless Object.const_defined?(:QUOTED_TYPE)
0
- else
0
- raise "Can't setup connection since ActiveRecord isn't loaded."
0
       end
0
- end
0
 
0
- # Load actionpack sqlite tables
0
- def load_schema
0
- File.read(File.dirname(__FILE__) + "/fixtures/db_definitions/sqlite.sql").split(';').each do |sql|
0
- ActiveRecord::Base.connection.execute(sql) unless sql.blank?
0
+ # Load actionpack sqlite tables
0
+ def load_schema
0
+ File.read(File.dirname(__FILE__) + "/fixtures/db_definitions/sqlite.sql").split(';').each do |sql|
0
+ ActiveRecord::Base.connection.execute(sql) unless sql.blank?
0
+ end
0
       end
0
- end
0
 
0
- def require_fixture_models
0
- Dir.glob(File.dirname(__FILE__) + "/fixtures/*.rb").each {|f| require f}
0
- end
0
+ def require_fixture_models
0
+ Dir.glob(File.dirname(__FILE__) + "/fixtures/*.rb").each {|f| require f}
0
+ end
0
   end
0
 end
0
 
0
 class ActiveRecordTestCase < ActiveSupport::TestCase
0
   # Set our fixture path
0
   if ActiveRecordTestConnector.able_to_connect
0
- self.fixture_path = "#{File.dirname(__FILE__)}/fixtures/"
0
+ self.fixture_path = [FIXTURE_LOAD_PATH]
0
     self.use_transactional_fixtures = false
0
   end
0
 
...
40
41
42
43
 
 
44
45
46
47
 
48
49
50
...
56
57
58
59
 
60
61
62
63
64
 
65
66
67
68
69
 
70
71
72
73
74
 
75
76
77
...
116
117
118
119
 
 
120
121
122
...
134
135
136
137
 
 
138
139
140
...
146
147
148
149
 
 
150
151
152
...
167
168
169
170
171
172
173
...
187
188
189
190
191
192
 
...
40
41
42
 
43
44
45
46
47
 
48
49
50
51
...
57
58
59
 
60
61
62
63
64
 
65
66
67
68
69
 
70
71
72
73
74
 
75
76
77
78
...
117
118
119
 
120
121
122
123
124
...
136
137
138
 
139
140
141
142
143
...
149
150
151
 
152
153
154
155
156
...
171
172
173
 
174
175
176
...
190
191
192
 
 
193
194
0
@@ -40,11 +40,12 @@ class RenderPartialWithRecordIdentificationController < ActionController::Base
0
     render :partial => @developers
0
   end
0
 end
0
-RenderPartialWithRecordIdentificationController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+
0
+RenderPartialWithRecordIdentificationController.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
 class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase
0
   fixtures :developers, :projects, :developers_projects, :topics, :replies, :companies, :mascots
0
-
0
+
0
   def setup
0
     @controller = RenderPartialWithRecordIdentificationController.new
0
     @request = ActionController::TestRequest.new
0
@@ -56,22 +57,22 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase
0
     get :render_with_has_many_and_belongs_to_association
0
     assert_template 'projects/_project'
0
   end
0
-
0
+
0
   def test_rendering_partial_with_has_many_association
0
     get :render_with_has_many_association
0
     assert_template 'replies/_reply'
0
   end
0
-
0
+
0
   def test_rendering_partial_with_named_scope
0
     get :render_with_named_scope
0
     assert_template 'replies/_reply'
0
   end
0
-
0
+
0
   def test_render_with_record
0
     get :render_with_record
0
     assert_template 'developers/_developer'
0
   end
0
-
0
+
0
   def test_render_with_record_collection
0
     get :render_with_record_collection
0
     assert_template 'developers/_developer'
0
@@ -116,7 +117,8 @@ class RenderPartialWithRecordIdentificationController < ActionController::Base
0
     render :partial => @developers
0
   end
0
 end
0
-RenderPartialWithRecordIdentificationController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+
0
+RenderPartialWithRecordIdentificationController.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
 class Game < Struct.new(:name, :id)
0
   def to_param
0
@@ -134,7 +136,8 @@ module Fun
0
       render :partial => [ Game.new("Pong"), Game.new("Tank") ]
0
     end
0
   end
0
- NestedController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+
0
+ NestedController.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
   module Serious
0
     class NestedDeeperController < ActionController::Base
0
@@ -146,7 +149,8 @@ module Fun
0
         render :partial => [ Game.new("Chess"), Game.new("Sudoku"), Game.new("Solitaire") ]
0
       end
0
     end
0
- NestedDeeperController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+
0
+ NestedDeeperController.view_paths = [FIXTURE_LOAD_PATH]
0
   end
0
 end
0
 
0
@@ -167,7 +171,6 @@ class RenderPartialWithRecordIdentificationAndNestedControllersTest < ActiveReco
0
     get :render_with_record_collection_in_nested_controller
0
     assert_template 'fun/games/_game'
0
   end
0
-
0
 end
0
 
0
 class RenderPartialWithRecordIdentificationAndNestedDeeperControllersTest < ActiveRecordTestCase
0
@@ -187,5 +190,4 @@ class RenderPartialWithRecordIdentificationAndNestedDeeperControllersTest < Acti
0
     get :render_with_record_collection_in_deeper_nested_controller
0
     assert_template 'fun/serious/games/_game'
0
   end
0
-
0
-end
0
\ No newline at end of file
0
+end
...
157
158
159
160
 
161
162
163
...
170
171
172
173
 
174
175
176
...
533
534
535
536
537
538
539
...
157
158
159
 
160
161
162
163
...
170
171
172
 
173
174
175
176
...
533
534
535
 
536
537
538
0
@@ -157,7 +157,7 @@ module Admin
0
     def redirect_to_fellow_controller
0
       redirect_to :controller => 'user'
0
     end
0
-
0
+
0
     def redirect_to_top_level_named_route
0
       redirect_to top_level_url(:id => "foo")
0
     end
0
@@ -170,7 +170,7 @@ end
0
 # tell the controller where to find its templates but start from parent
0
 # directory of test_request_response to simulate the behaviour of a
0
 # production environment
0
-ActionPackAssertionsController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+ActionPackAssertionsController.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
 # a test case to exercise the new capabilities TestRequest & TestResponse
0
 class ActionPackAssertionsControllerTest < Test::Unit::TestCase
0
@@ -533,7 +533,6 @@ class ActionPackHeaderTest < Test::Unit::TestCase
0
     assert_equal('application/pdf; charset=utf-8', @response.headers['type'])
0
   end
0
 
0
-
0
   def test_render_text_with_custom_content_type
0
     get :render_text_with_custom_content_type
0
     assert_equal 'application/rss+xml; charset=utf-8', @response.headers['type']
...
1
2
3
4
5
6
7
...
20
21
22
23
 
24
25
26
...
1
2
3
 
4
5
6
...
19
20
21
 
22
23
24
25
0
@@ -1,7 +1,6 @@
0
 require 'abstract_unit'
0
 
0
 class Address
0
-
0
   def Address.count(conditions = nil, join = nil)
0
     nil
0
   end
0
@@ -20,7 +19,7 @@ class AddressesTestController < ActionController::Base
0
   def self.controller_path; "addresses"; end
0
 end
0
 
0
-AddressesTestController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+AddressesTestController.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
 class AddressesTest < Test::Unit::TestCase
0
   def setup
...
6
7
8
9
 
10
11
12
...
631
632
633
634
 
635
636
637
...
642
643
644
 
645
646
647
...
6
7
8
 
9
10
11
12
...
631
632
633
 
634
635
636
637
...
642
643
644
645
646
647
648
0
@@ -6,7 +6,7 @@ CACHE_DIR = 'test_cache'
0
 FILE_STORE_PATH = File.join(File.dirname(__FILE__), '/../temp/', CACHE_DIR)
0
 ActionController::Base.page_cache_directory = FILE_STORE_PATH
0
 ActionController::Base.cache_store = :file_store, FILE_STORE_PATH
0
-ActionController::Base.view_paths = [ File.dirname(__FILE__) + '/../fixtures/' ]
0
+ActionController::Base.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
 class PageCachingTestController < ActionController::Base
0
   caches_page :ok, :no_content, :if => Proc.new { |c| !c.request.format.json? }
0
@@ -631,7 +631,7 @@ class FunctionalCachingController < ActionController::Base
0
   end
0
 end
0
 
0
-FunctionalCachingController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+FunctionalCachingController.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
 class FunctionalFragmentCachingTest < Test::Unit::TestCase
0
   def setup
0
@@ -642,6 +642,7 @@ class FunctionalFragmentCachingTest < Test::Unit::TestCase
0
     @request = ActionController::TestRequest.new
0
     @response = ActionController::TestResponse.new
0
   end
0
+
0
   def test_fragment_caching
0
     get :fragment_cached
0
     assert_response :success
...
23
24
25
26
 
27
28
29
...
23
24
25
 
26
27
28
29
0
@@ -23,7 +23,7 @@ class CaptureController < ActionController::Base
0
   def rescue_action(e) raise end
0
 end
0
 
0
-CaptureController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+CaptureController.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
 class CaptureTest < Test::Unit::TestCase
0
   def setup
...
13
14
15
16
 
17
18
19
20
21
 
22
23
24
...
45
46
47
48
 
49
50
51
...
68
69
70
71
 
72
73
74
...
76
77
78
79
 
80
81
82
83
84
85
 
86
87
88
...
94
95
96
97
 
98
99
100
101
102
103
 
104
105
106
107
108
109
 
110
111
112
113
114
115
 
116
117
 
118
119
120
...
130
131
132
133
 
134
135
136
...
13
14
15
 
16
17
18
19
20
 
21
22
23
24
...
45
46
47
 
48
49
50
51
...
68
69
70
 
71
72
73
74
...
76
77
78
 
79
80
81
82
83
84
 
85
86
87
88
...
94
95
96
 
97
98
99
100
101
102
 
103
104
105
106
107
108
 
109
110
111
112
113
114
 
115
116
 
117
118
119
120
...
130
131
132
 
133
134
135
136
0
@@ -13,12 +13,12 @@ class ContentTypeController < ActionController::Base
0
   def render_content_type_from_render
0
     render :text => "hello world!", :content_type => Mime::RSS
0
   end
0
-
0
+
0
   def render_charset_from_body
0
     response.charset = "utf-16"
0
     render :text => "hello world!"
0
   end
0
-
0
+
0
   def render_default_for_rhtml
0
   end
0
 
0
@@ -45,7 +45,7 @@ class ContentTypeController < ActionController::Base
0
   def rescue_action(e) raise end
0
 end
0
 
0
-ContentTypeController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+ContentTypeController.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
 class ContentTypeTest < Test::Unit::TestCase
0
   def setup
0
@@ -68,7 +68,7 @@ class ContentTypeTest < Test::Unit::TestCase
0
   def test_render_changed_charset_default
0
     ContentTypeController.default_charset = "utf-16"
0
     get :render_defaults
0
- assert_equal "utf-16", @response.charset
0
+ assert_equal "utf-16", @response.charset
0
     assert_equal Mime::HTML, @response.content_type
0
     ContentTypeController.default_charset = "utf-8"
0
   end
0
@@ -76,13 +76,13 @@ class ContentTypeTest < Test::Unit::TestCase
0
   def test_content_type_from_body
0
     get :render_content_type_from_body
0
     assert_equal "application/rss+xml", @response.content_type
0
- assert_equal "utf-8", @response.charset
0
+ assert_equal "utf-8", @response.charset
0
   end
0
 
0
   def test_content_type_from_render
0
     get :render_content_type_from_render
0
     assert_equal "application/rss+xml", @response.content_type
0
- assert_equal "utf-8", @response.charset
0
+ assert_equal "utf-8", @response.charset
0
   end
0
 
0
   def test_charset_from_body
0
@@ -94,27 +94,27 @@ class ContentTypeTest < Test::Unit::TestCase
0
   def test_default_for_rhtml
0
     get :render_default_for_rhtml
0
     assert_equal Mime::HTML, @response.content_type
0
- assert_equal "utf-8", @response.charset
0
+ assert_equal "utf-8", @response.charset
0
   end
0
 
0
   def test_default_for_rxml
0
     get :render_default_for_rxml
0
     assert_equal Mime::XML, @response.content_type
0
- assert_equal "utf-8", @response.charset
0
+ assert_equal "utf-8", @response.charset
0
   end
0
 
0
   def test_default_for_rjs
0
     xhr :post, :render_default_for_rjs
0
     assert_equal Mime::JS, @response.content_type
0
- assert_equal "utf-8", @response.charset
0
+ assert_equal "utf-8", @response.charset
0
   end
0
 
0
   def test_change_for_rxml
0
     get :render_change_for_rxml
0
     assert_equal Mime::HTML, @response.content_type
0
- assert_equal "utf-8", @response.charset
0
+ assert_equal "utf-8", @response.charset
0
   end
0
-
0
+
0
   def test_render_default_content_types_for_respond_to
0
     @request.env["HTTP_ACCEPT"] = Mime::HTML.to_s
0
     get :render_default_content_types_for_respond_to
0
@@ -130,7 +130,7 @@ class ContentTypeTest < Test::Unit::TestCase
0
     get :render_default_content_types_for_respond_to
0
     assert_equal Mime::XML, @response.content_type
0
   end
0
-
0
+
0
   def test_render_default_content_types_for_respond_to_with_overwrite
0
     @request.env["HTTP_ACCEPT"] = Mime::RSS.to_s
0
     get :render_default_content_types_for_respond_to
...
2
3
4
5
6
7
8
...
14
15
16
17
 
18
19
20
...
2
3
4
 
5
6
7
...
13
14
15
 
16
17
18
19
0
@@ -2,7 +2,6 @@ require 'abstract_unit'
0
 
0
 class DeprecatedBaseMethodsTest < Test::Unit::TestCase
0
   class Target < ActionController::Base
0
-
0
     def home_url(greeting)
0
       "http://example.com/#{greeting}"
0
     end
0
@@ -14,7 +13,7 @@ class DeprecatedBaseMethodsTest < Test::Unit::TestCase
0
     def rescue_action(e) raise e end
0
   end
0
 
0
- Target.view_paths = [ File.dirname(__FILE__) + "/../../fixtures" ]
0
+ Target.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
   def setup
0
     @request = ActionController::TestRequest.new
...
107
108
109
110
 
111
112
113
...
120
121
122
123
124
125
 
 
 
126
127
128
 
129
130
131
...
138
139
140
141
 
142
143
144
...
162
163
164
165
 
166
167
168
...
247
248
249
250
 
251
252
253
...
347
348
349
350
 
351
352
353
354
355
 
356
357
358
...
364
365
366
367
 
368
369
370
...
445
446
447
448
449
 
 
450
451
452
453
 
 
454
455
456
457
458
 
 
459
460
461
462
463
464
 
465
466
467
468
 
469
470
471
472
 
473
474
475
...
497
498
499
500
 
501
502
503
...
514
515
516
517
 
518
519
520
 
521
522
523
524
525
526
 
527
528
529
 
530
531
532
 
533
534
535
536
537
538
...
107
108
109
 
110
111
112
113
...
120
121
122
 
 
 
123
124
125
126
127
 
128
129
130
131
...
138
139
140
 
141
142
143
144
...
162
163
164
 
165
166
167
168
...
247
248
249
 
250
251
252
253
...
347
348
349
 
350
351
352
353
354
 
355
356
357
358
...
364
365
366
 
367
368
369
370
...
445
446
447
 
 
448
449
450
451
 
 
452
453
454
455
456
 
 
457
458
459
460
461
462
463
 
464
465
466
467
 
468
469
470
471
 
472
473
474
475
...
497
498
499
 
500
501
502
503
...
514
515
516
 
517
518
519
 
520
521
522
523
524
525
 
526
527
528
 
529
530
531
 
532
533
534
535
536
537
 
0
@@ -107,7 +107,7 @@ class RespondToController < ActionController::Base
0
       type.any(:js, :xml) { render :text => "Either JS or XML" }
0
     end
0
   end
0
-
0
+
0
   def handle_any_any
0
     respond_to do |type|
0
       type.html { render :text => 'HTML' }
0
@@ -120,12 +120,12 @@ class RespondToController < ActionController::Base
0
       type.html
0
       type.js
0
     end
0
- end
0
-
0
- def iphone_with_html_response_type
0
+ end
0
+
0
+ def iphone_with_html_response_type
0
     Mime::Type.register_alias("text/html", :iphone)
0
     request.format = :iphone if request.env["HTTP_ACCEPT"] == "text/iphone"
0
-
0
+
0
     respond_to do |type|
0
       type.html { @type = "Firefox" }
0
       type.iphone { @type = "iPhone" }
0
@@ -138,7 +138,7 @@ class RespondToController < ActionController::Base
0
   def iphone_with_html_response_type_without_layout
0
     Mime::Type.register_alias("text/html", :iphone)
0
     request.format = "iphone" if request.env["HTTP_ACCEPT"] == "text/iphone"
0
-
0
+
0
     respond_to do |type|
0
       type.html { @type = "Firefox"; render :action => "iphone_with_html_response_type" }
0
       type.iphone { @type = "iPhone" ; render :action => "iphone_with_html_response_type" }
0
@@ -162,7 +162,7 @@ class RespondToController < ActionController::Base
0
     end
0
 end
0
 
0
-RespondToController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
0
+RespondToController.view_paths = [FIXTURE_LOAD_PATH]
0
 
0
 class MimeControllerTest < Test::Unit::TestCase
0
   def setup
0
@@ -247,7 +247,7 @@ class MimeControllerTest < Test::Unit::TestCase
0
     get :just_xml
0
     assert_equal 'XML', @response.body
0
   end
0
-
0
+
0
   def test_using_defaults
0
     @request.env["HTTP_ACCEPT"] = "*/*"
0
     get :using_defaults
0
@@ -347,12 +347,12 @@ class MimeControllerTest < Test::Unit::TestCase
0
     get :handle_any_any
0
     assert_equal 'HTML', @response.body
0
   end
0
-
0
+
0
   def test_handle_any_any_parameter_format
0
     get :handle_any_any, {:format=>'html'}
0
     assert_equal 'HTML', @response.body
0
   end
0
-
0
+
0
   def test_handle_any_any_explicit_html
0
     @request.env["HTTP_ACCEPT"] = "text/html"
0
     get :handle_any_any
0
@@ -364,7 +364,7 @@ class MimeControllerTest < Test::Unit::TestCase
0
     get :handle_any_any
0
     assert_equal 'Whatever you ask for, I got it', @response.body
0
   end
0
-
0
+
0
   def test_handle_any_any_xml
0
     @request.env["HTTP_ACCEPT"] = "text/xml"
0
     get :handle_any_any
0
@@ -445,31 +445,31 @@ class MimeControllerTest < Test::Unit::TestCase
0
 
0
     get :using_defaults, :format => "xml"
0
     assert_equal "using_defaults - xml", @response.body
0
- end
0
-
0
+ end
0
+
0
   def test_format_with_custom_response_type
0
     get :iphone_with_html_response_type
0
- assert_equal '<html><div id="html">Hello future from Firefox!</div></html>', @response.body
0
-
0
+ assert_equal '<html><div id="html">Hello future from Firefox!</div></html>', @response.body
0
+
0
     get :iphone_with_html_response_type, :format => "iphone"
0
     assert_equal "text/html", @response.content_type
0
     assert_equal '<html><div id="iphone">Hello iPhone future from iPhone!</div></html>', @response.body
0
- end
0
-
0
+ end
0
+
0
   def test_format_with_custom_response_type_and_request_headers
0
     @request.env["HTTP_ACCEPT"] = "text/iphone"
0
     get :iphone_with_html_response_type
0
     assert_equal '<html><div id="iphone">Hello iPhone future from iPhone!</div></html>', @response.body
0
     assert_equal "text/html", @response.content_type
0
- end
0
+ end
0
 
0
   def test_format_with_custom_response_type_and_request_headers_with_only_one_layout_present
0
     get :iphone_with_html_response_type_without_layout
0
- assert_equal '<html><div id="html_missing">Hello future from Firefox!</div></html>', @response.body
0
+ assert_equal '<html><div id="html_missing">Hello future from Firefox!</div></html>', @response.body
0
 
0
     @request.env["HTTP_ACCEPT"] = "text/iphone"
0
     assert_raises(ActionView::MissingTemplate) { get :iphone_with_html_response_type_without_layout }
0
- end
0
+ end
0
 end
0
 
0
 class AbstractPostController < ActionController::Base
0
@@ -497,7 +497,7 @@ class PostController < AbstractPostController
0
     end
0
 end
0
 
0
-class SuperPostController < PostController
0
+class SuperPostController < PostController
0
   def index
0
     respond_to do |type|
0
       type.html
0
@@ -514,25 +514,24 @@ class MimeControllerLayoutsTest < Test::Unit::TestCase
0
     @controller = PostController.new
0
     @request.host = "www.example.com"
0
   end
0
-
0
+
0
   def test_missing_layout_renders_properly
0
     get :index
0
- assert_equal '<html><div id="html">Hello Firefox</div></html>', @response.body
0
+ assert_equal '<html><div id="html">Hello Firefox</div></html>', @response.body
0
 
0
     @request.env["HTTP_ACCEPT"] = "text/iphone"
0
     get :index
0
     assert_equal 'Hello iPhone', @response.body
0
   end
0
-
0
+
0
   def test_format_with_inherited_layouts
0
     @controller = SuperPostController.new
0
-
0
+
0
     get :index
0
     assert_equal 'Super Firefox', @response.body
0
-
0
+
0
     @request.env["HTTP_ACCEPT"] = "text/iphone"
0
     get :index
0
     assert_equal '<html><div id="super_iphone">Super iPhone</div></html>', @response.body
0
   end
0
 end
0
-