html_escape_once

html_escape_once(s) Class Public methods A utility method for escaping HTML without affecting existing escaped entities. html_escape_once('1 < 2 &amp; 3') # => "1 &lt; 2 &amp; 3" html_escape_once('&lt;&lt; Accept & Checkout') # => "&lt;&lt; Accept &amp; Checkout"

root

root(path, options={}) Instance Public methods

reconnect!

reconnect!() Instance Public methods Disconnects from the database if already connected, and establishes a new connection with the database. Implementors should call super if they override the default implementation.

to_hash

to_hash() Instance Public methods

travel

travel(duration, &block) Instance Public methods Changes current time to the time in the future or in the past by a given time difference by stubbing Time.now and Date.today. Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 travel 1.day Time.current # => Sun, 10 Nov 2013 15:34:49 EST -05:00 Date.current # => Sun, 10 Nov 2013 This method also accepts a block, which will return the current time back to its original state at the end of the block: Time.current # =&g

inflections

inflections(locale = :en) Instance Public methods Yields a singleton instance of Inflector::Inflections so you can specify additional inflector rules. If passed an optional locale, rules for other languages can be specified. If not specified, defaults to :en. Only rules for English are provided. ActiveSupport::Inflector.inflections(:en) do |inflect| inflect.uncountable 'rails' end

as_json

as_json(options = nil) Instance Public methods Coerces time to a string for JSON encoding. The default format is ISO 8601. You can get %Y/%m/%d %H:%M:%S +offset style by setting ActiveSupport::JSON::Encoding.use_standard_json_time_format to false. # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = true Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").to_json # => "2005-02-01T05:15:10.000-10:00" # With ActiveSupport::JSON::Encoding.use_standard_json_time_form

context_class

context_class() Class Public methods Superclass for the evaluation contexts used by ERB fixtures.

assert_no_difference

assert_no_difference(expression, message = nil, &block) Instance Public methods Assertion that the numeric result of evaluating an expression is not changed before and after invoking the passed in block. assert_no_difference 'Article.count' do post :create, article: invalid_attributes end An error message can be specified. assert_no_difference 'Article.count', 'An Article should not be created' do post :create, article: invalid_attributes end

references

references(*args) Instance Public methods Also aliased as: belongs_to