Commit Graph

14 Commits

Author SHA1 Message Date
Elliot Winkler afa6a7b666 Update RSpec test style across docs
Instead of using

    describe Foo do
      # ...
    end

use

    RSpec.describe Foo, type: :model do
      # ...
    end

instead. This is not exactly official, as the former style still works,
but the latter style is highly suggested in RSpec documentation and the
like, so this is what people are used to.

[ci skip]
2016-06-15 18:02:07 -06:00
Elliot Winkler 417f289a86 confirmation: Refactor to use AttributeSetter
When the confirmation matcher is setting the confirmation attribute, we
want it to raise an exception if the model does not have that attribute,
same as if it would raise an exception if the attribute under test did
not exist.
2015-12-30 21:37:14 -05:00
Elliot Winkler cecccc6836 Refactor confirmation matcher
This is part of a collection of commits that aim to improve failure
messages across the board, in order to make matchers easier to debug
when something goes wrong.

* Make the description of the matcher more readable.
2015-12-13 20:22:22 -07:00
Elliot Winkler 142366ef16 Refer to Minitest in docs over Test::Unit
Minitest has been used instead of Test::Unit for quite some time now,
let's get with the times.

[ci skip]
2015-09-30 13:18:23 -06:00
Mauro George f3e24436d8 Add documentation to validate_confirmation_of on qualifier
[ci skip]
2015-03-28 22:33:44 -06:00
Elliot Winkler a4045a1f9b Remove Rails 3.x, Ruby 1.9.2, Ruby 1.9.3
Ruby 1.9.3 will be end-of-lifed on February 23, 2015. We might as well
remove support for it now.
2015-02-09 10:52:22 -07:00
Elliot Winkler a1d1635383 Fix allow_value + i18n validation messages
Previously, `allow_value` failed when qualified with `with_message` and
the `:against` option. This also happened to propagate downward to
`validate_confirmation_of` since it uses `allow_value` + `:against`
(when a confirmation validation fails, it assigns the error message to
the *_confirmation attribute, not the attribute being confirmed).
This commit fixes both matchers.
2014-10-21 01:23:47 -06:00
Elliot Winkler 12cc7aaace Remove all Ruby-emitted warnings
Run RSpec tests with warnings enabled so we stay on top of this better
in the future.
2014-07-18 18:00:08 -06:00
Elliot Winkler c22d7c89e0 Extract examples in README to inline documentation 2014-06-20 16:41:27 -06:00
Yukio Mizuta 90c4a7d215 Use __send__ instead of send 2014-02-01 13:09:44 -08:00
Elliot Winkler a026afb800 Fix validates_confirmation_of matcher so that it works under Rails 4
Rails 4 changed how validates_confirmation_of works so that the error
message is applied to the confirmation attribute, not the original
attribute.
2013-08-16 16:17:26 -06:00
Melissa Xie 632b4cfa70 Use correct variable in validate_confirmation_of matcher description 2013-03-25 10:11:50 -04:00
Gabe Berke-Williams af8f9a7bff Use current thoughtbot style in specs 2012-12-26 22:45:54 -05:00
Blake Thomson 1b5fc27cf8 Add validates_confirmation_of matcher 2011-12-15 11:42:26 -05:00