Changeset 5358
- Timestamp:
- 10/24/06 17:14:50 (2 years ago)
- Files:
-
- trunk/actionpack/lib/action_controller/assertions/deprecated_assertions.rb (modified) (23 diffs)
- trunk/actionpack/lib/action_view/helpers/form_tag_helper.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/number_helper.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/url_helper.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/assertions/deprecated_assertions.rb
r4962 r5358 7 7 assert_response(:success, message) 8 8 end 9 deprecate :assert_success 9 deprecate :assert_success => "use assert_response(:success)" 10 10 11 11 def assert_redirect(message=nil) #:nodoc: 12 12 assert_response(:redirect, message) 13 13 end 14 deprecate :assert_redirect 14 deprecate :assert_redirect => "use assert_response(:redirect)" 15 15 16 16 def assert_rendered_file(expected=nil, message=nil) #:nodoc: 17 17 assert_template(expected, message) 18 18 end 19 deprecate :assert_rendered_file 19 deprecate :assert_rendered_file => :assert_template 20 20 21 21 # ensure that the session has an object with the specified name … … 24 24 assert_block(msg) { @response.has_session_object?(key) } 25 25 end 26 deprecate :assert_session_has 26 deprecate :assert_session_has => "use assert(@response.has_session_object?(key))" 27 27 28 28 # ensure that the session has no object with the specified name … … 31 31 assert_block(msg) { !@response.has_session_object?(key) } 32 32 end 33 deprecate :assert_session_has_no 33 deprecate :assert_session_has_no => "use assert(!@response.has_session_object?(key))" 34 34 35 35 def assert_session_equal(expected = nil, key = nil, message = nil) #:nodoc: … … 37 37 assert_block(msg) { expected == @response.session[key] } 38 38 end 39 deprecate :assert_session_equal 39 deprecate :assert_session_equal => "use assert_equal(expected, @response[key])" 40 40 41 41 # -- cookie assertions --------------------------------------------------- … … 46 46 assert_block(msg) { actual.nil? or actual.empty? } 47 47 end 48 deprecate :assert_no_cookie 48 deprecate :assert_no_cookie => "use assert(!@response.cookies.key?(key))" 49 49 50 50 def assert_cookie_equal(expected = nil, key = nil, message = nil) #:nodoc: … … 54 54 assert_block(msg) { expected == actual } 55 55 end 56 deprecate :assert_cookie_equal 56 deprecate :assert_cookie_equal => "use assert(@response.cookies.key?(key))" 57 57 58 58 # -- flash assertions --------------------------------------------------- … … 63 63 assert_block(msg) { @response.has_flash_object?(key) } 64 64 end 65 deprecate :assert_flash_has 65 deprecate :assert_flash_has => "use assert(@response.has_flash_object?(key))" 66 66 67 67 # ensure that the flash has no object with the specified name … … 70 70 assert_block(msg) { !@response.has_flash_object?(key) } 71 71 end 72 deprecate :assert_flash_has_no 72 deprecate :assert_flash_has_no => "use assert(!@response.has_flash_object?(key))" 73 73 74 74 # ensure the flash exists … … 77 77 assert_block(msg) { @response.has_flash? } 78 78 end 79 deprecate :assert_flash_exists 79 deprecate :assert_flash_exists => "use assert(@response.has_flash?)" 80 80 81 81 # ensure the flash does not exist … … 84 84 assert_block(msg) { !@response.has_flash? } 85 85 end 86 deprecate :assert_flash_not_exists 86 deprecate :assert_flash_not_exists => "use assert(!@response.has_flash?)" 87 87 88 88 # ensure the flash is empty but existent … … 91 91 assert_block(msg) { !@response.has_flash_with_contents? } 92 92 end 93 deprecate :assert_flash_empty 93 deprecate :assert_flash_empty => "use assert(!@response.has_flash_with_contents?)" 94 94 95 95 # ensure the flash is not empty … … 98 98 assert_block(msg) { @response.has_flash_with_contents? } 99 99 end 100 deprecate :assert_flash_not_empty 100 deprecate :assert_flash_not_empty => "use assert(@response.has_flash_with_contents?)" 101 101 102 102 def assert_flash_equal(expected = nil, key = nil, message = nil) #:nodoc: … … 104 104 assert_block(msg) { expected == @response.flash[key] } 105 105 end 106 deprecate :assert_flash_equal 106 deprecate :assert_flash_equal => "use assert_equal(expected, @response.flash[key])" 107 107 108 108 … … 113 113 assert_block(msg) { @response.redirect_url == url } 114 114 end 115 deprecate :assert_redirect_url 115 deprecate :assert_redirect_url => "use assert_equal(url, @response.redirect_url)" 116 116 117 117 # ensure our redirection url matches a pattern … … 121 121 assert_block(msg) { @response.redirect_url_match?(pattern) } 122 122 end 123 deprecate :assert_redirect_url_match 123 deprecate :assert_redirect_url_match => "use assert(@response.redirect_url_match?(pattern))" 124 124 125 125 … … 131 131 assert_block(msg) { @response.has_template_object?(key) } 132 132 end 133 deprecate :assert_template_has 133 deprecate :assert_template_has => "use assert(@response.has_template_object?(key))" 134 134 135 135 # ensure that a template object with the given name does not exist … … 138 138 assert_block(msg) { !@response.has_template_object?(key) } 139 139 end 140 deprecate :assert_template_has_no 140 deprecate :assert_template_has_no => "use assert(!@response.has_template_object?(key))" 141 141 142 142 # ensures that the object assigned to the template on +key+ is equal to +expected+ object. … … 146 146 end 147 147 alias_method :assert_assigned_equal, :assert_template_equal 148 deprecate :assert_assigned_equal 149 deprecate :assert_template_equal 148 deprecate :assert_assigned_equal => "use assert_equal(expected, @response.template.assigns[key.to_s])" 149 deprecate :assert_template_equal => "use assert_equal(expected, @response.template.assigns[key.to_s])" 150 150 151 151 # Asserts that the template returns the +expected+ string or array based on the XPath +expression+. … … 165 165 assert_block(msg) { matches == expected } 166 166 end 167 deprecate :assert_template_xpath_match 167 deprecate :assert_template_xpath_match => "you should use assert_tag, instead" 168 168 169 169 # Assert the template object with the given name is an Active Record descendant and is valid. … … 173 173 assert_block(msg) { record.valid? } 174 174 end 175 deprecate :assert_valid_record 175 deprecate :assert_valid_record => "use assert(assigns(key).valid?)" 176 176 177 177 # Assert the template object with the given name is an Active Record descendant and is invalid. … … 181 181 assert_block(msg) { !record.valid? } 182 182 end 183 deprecate :assert_invalid_record 183 deprecate :assert_invalid_record => "use assert(!assigns(key).valid?)" 184 184 185 185 # Assert the template object with the given name is an Active Record descendant and the specified column(s) are valid. … … 193 193 assert_block(msg) { cols.empty? } 194 194 end 195 deprecate :assert_valid_column_on_record 195 deprecate :assert_valid_column_on_record => "use assert(!record.errors.invalid?(column)) instead" 196 196 197 197 # Assert the template object with the given name is an Active Record descendant and the specified column(s) are invalid. … … 205 205 assert_block(msg) { cols.empty? } 206 206 end 207 deprecate :assert_invalid_column_on_record 207 deprecate :assert_invalid_column_on_record => "use assert(record.errors.invalid?(column)) instead" 208 208 209 209 private trunk/actionpack/lib/action_view/helpers/form_tag_helper.rb
r5347 r5358 65 65 end 66 66 67 deprecate :end_form_tag, :start_form_tag 67 deprecate :end_form_tag, :start_form_tag => :form_tag 68 68 69 69 # Creates a dropdown selection box, or if the <tt>:multiple</tt> option is set to true, a multiple trunk/actionpack/lib/action_view/helpers/number_helper.rb
r5336 r5358 150 150 151 151 alias_method :human_size, :number_to_human_size # deprecated alias 152 deprecate :human_size 152 deprecate :human_size => :number_to_human_size 153 153 end 154 154 end trunk/actionpack/lib/action_view/helpers/url_helper.rb
r5338 r5358 175 175 176 176 alias_method :link_to_image, :link_image_to 177 deprecate :link_image_to 177 deprecate :link_image_to => :link_to_image 178 178 179 179 # Creates a link tag of the given +name+ using a URL created by the set of