@@ -176,14 +176,14 @@ def test_render_partial_with_locals_from_default
176
176
def test_render_partial_with_invalid_name
177
177
e = assert_raises ( ArgumentError ) { @view . render ( :partial => "test/200" ) }
178
178
assert_equal "The partial name (test/200) is not a valid Ruby identifier; " +
179
- "make sure your partial name starts with a lowercase letter or underscore, " +
179
+ "make sure your partial name starts with underscore, " +
180
180
"and is followed by any combination of letters, numbers and underscores." , e . message
181
181
end
182
182
183
183
def test_render_partial_with_missing_filename
184
184
e = assert_raises ( ArgumentError ) { @view . render ( :partial => "test/" ) }
185
185
assert_equal "The partial name (test/) is not a valid Ruby identifier; " +
186
- "make sure your partial name starts with a lowercase letter or underscore, " +
186
+ "make sure your partial name starts with underscore, " +
187
187
"and is followed by any combination of letters, numbers and underscores." , e . message
188
188
end
189
189
@@ -195,7 +195,21 @@ def test_render_partial_with_incompatible_object
195
195
def test_render_partial_with_hyphen
196
196
e = assert_raises ( ArgumentError ) { @view . render ( :partial => "test/a-in" ) }
197
197
assert_equal "The partial name (test/a-in) is not a valid Ruby identifier; " +
198
- "make sure your partial name starts with a lowercase letter or underscore, " +
198
+ "make sure your partial name starts with underscore, " +
199
+ "and is followed by any combination of letters, numbers and underscores." , e . message
200
+ end
201
+
202
+ def test_render_partial_with_invalid_option_as
203
+ e = assert_raises ( ArgumentError ) { @view . render ( :partial => "test/partial_only" , :as => 'a-in' ) }
204
+ assert_equal "The value (a-in) of the option `as` is not a valid Ruby identifier; " +
205
+ "make sure it starts with lowercase letter, " +
206
+ "and is followed by any combination of letters, numbers and underscores." , e . message
207
+ end
208
+
209
+ def test_render_partial_with_hyphen_and_invalid_option_as
210
+ e = assert_raises ( ArgumentError ) { @view . render ( :partial => "test/a-in" , :as => 'a-in' ) }
211
+ assert_equal "The value (a-in) of the option `as` is not a valid Ruby identifier; " +
212
+ "make sure it starts with lowercase letter, " +
199
213
"and is followed by any combination of letters, numbers and underscores." , e . message
200
214
end
201
215
0 commit comments