Changeset 4938
- Timestamp:
- 09/03/06 20:36:51 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/assertions/deprecated_assertions.rb
r4935 r4938 7 7 assert_response(:success, message) 8 8 end 9 deprecate :assert_success 9 10 10 11 def assert_redirect(message=nil) #:nodoc: 11 12 assert_response(:redirect, message) 12 13 end 14 deprecate :assert_redirect 13 15 14 16 def assert_rendered_file(expected=nil, message=nil) #:nodoc: 15 17 assert_template(expected, message) 16 18 end 19 deprecate :assert_rendered_file 17 20 18 21 # ensure that the session has an object with the specified name … … 21 24 assert_block(msg) { @response.has_session_object?(key) } 22 25 end 26 deprecate :assert_session_has 23 27 24 28 # ensure that the session has no object with the specified name … … 27 31 assert_block(msg) { !@response.has_session_object?(key) } 28 32 end 33 deprecate :assert_session_has_no 29 34 30 35 def assert_session_equal(expected = nil, key = nil, message = nil) #:nodoc: … … 32 37 assert_block(msg) { expected == @response.session[key] } 33 38 end 39 deprecate :assert_session_equal 34 40 35 41 # -- cookie assertions --------------------------------------------------- … … 40 46 assert_block(msg) { actual.nil? or actual.empty? } 41 47 end 48 deprecate :assert_no_cookie 42 49 43 50 def assert_cookie_equal(expected = nil, key = nil, message = nil) #:nodoc: … … 47 54 assert_block(msg) { expected == actual } 48 55 end 56 deprecate :assert_cookie_equal 49 57 50 58 # -- flash assertions --------------------------------------------------- … … 55 63 assert_block(msg) { @response.has_flash_object?(key) } 56 64 end 65 deprecate :assert_flash_has 57 66 58 67 # ensure that the flash has no object with the specified name … … 61 70 assert_block(msg) { !@response.has_flash_object?(key) } 62 71 end 72 deprecate :assert_flash_has_no 63 73 64 74 # ensure the flash exists … … 67 77 assert_block(msg) { @response.has_flash? } 68 78 end 79 deprecate :assert_flash_exists 69 80 70 81 # ensure the flash does not exist … … 73 84 assert_block(msg) { !@response.has_flash? } 74 85 end 86 deprecate :assert_flash_not_exists 75 87 76 88 # ensure the flash is empty but existent … … 79 91 assert_block(msg) { !@response.has_flash_with_contents? } 80 92 end 93 deprecate :assert_flash_empty 81 94 82 95 # ensure the flash is not empty … … 85 98 assert_block(msg) { @response.has_flash_with_contents? } 86 99 end 100 deprecate :assert_flash_not_empty 87 101 88 102 def assert_flash_equal(expected = nil, key = nil, message = nil) #:nodoc: … … 90 104 assert_block(msg) { expected == @response.flash[key] } 91 105 end 106 deprecate :assert_flash_equal 92 107 93 108 … … 98 113 assert_block(msg) { @response.redirect_url == url } 99 114 end 115 deprecate :assert_redirect_url 100 116 101 117 # ensure our redirection url matches a pattern … … 105 121 assert_block(msg) { @response.redirect_url_match?(pattern) } 106 122 end 123 deprecate :assert_redirect_url_match 107 124 108 125 … … 114 131 assert_block(msg) { @response.has_template_object?(key) } 115 132 end 133 deprecate :assert_template_has 116 134 117 135 # ensure that a template object with the given name does not exist … … 120 138 assert_block(msg) { !@response.has_template_object?(key) } 121 139 end 140 deprecate :assert_template_has_no 122 141 123 142 # ensures that the object assigned to the template on +key+ is equal to +expected+ object. … … 127 146 end 128 147 alias_method :assert_assigned_equal, :assert_template_equal 148 deprecate :assert_assigned_equal 149 deprecate :assert_template_equal 129 150 130 151 # Asserts that the template returns the +expected+ string or array based on the XPath +expression+. … … 144 165 assert_block(msg) { matches == expected } 145 166 end 167 deprecate :assert_template_xpath_match 146 168 147 169 # Assert the template object with the given name is an Active Record descendant and is valid. … … 151 173 assert_block(msg) { record.valid? } 152 174 end 175 deprecate :assert_valid_record 153 176 154 177 # Assert the template object with the given name is an Active Record descendant and is invalid. … … 158 181 assert_block(msg) { !record.valid? } 159 182 end 183 deprecate :assert_invalid_record 160 184 161 185 # Assert the template object with the given name is an Active Record descendant and the specified column(s) are valid. … … 169 193 assert_block(msg) { cols.empty? } 170 194 end 195 deprecate :assert_valid_column_on_record 171 196 172 197 # Assert the template object with the given name is an Active Record descendant and the specified column(s) are invalid. … … 180 205 assert_block(msg) { cols.empty? } 181 206 end 207 deprecate :assert_invalid_column_on_record 182 208 183 209 private