Remove set_the_flash in favor of set_flash

This commit is contained in:
Elliot Winkler 2014-11-19 16:17:48 -07:00
parent cc2772324a
commit 801f2c7c1e
3 changed files with 114 additions and 136 deletions

View File

@ -13,6 +13,8 @@
* `ensure_inclusion_of`, `ensure_exclusion_of`, and `ensure_length_of` have been
removed in favor of their `validate_*` counterparts.
* `set_the_flash` has been removed in favor of `set_flash`.
# 2.8.0
### Deprecations

View File

@ -149,16 +149,6 @@ module Shoulda
SetFlashMatcher.new
end
# @deprecated Use {#set_flash} instead.
# @return [SetFlashMatcher]
def set_the_flash
Shoulda::Matchers.warn_about_deprecated_method(
:set_the_flash,
:set_flash
)
set_flash
end
# @private
class SetFlashMatcher
def initialize

View File

@ -1,19 +1,6 @@
require 'unit_spec_helper'
describe Shoulda::Matchers::ActionController, type: :controller do
describe '#set_the_flash' do
it 'is deprecated in favor of #set_flash' do
expect { set_the_flash }.to deprecate(:set_the_flash, :set_flash)
end
it 'still works regardless' do
silence_warnings do
expect(controller_with_flash(notice: 'hi')).to set_the_flash
end
end
end
describe '#set_flash' do
describe Shoulda::Matchers::ActionController::SetFlashMatcher, type: :controller do
it 'fails with unmatchable #to' do
expect { set_flash.to(1) }.to raise_error('cannot match against 1')
end
@ -143,7 +130,6 @@ describe Shoulda::Matchers::ActionController, type: :controller do
expect(controller_with_no_flashes).not_to set_flash
end
end
end
def controller_with_no_flashes
build_fake_response