Module: Clearance::Shoulda::Helpers
- Included in:
- Test::Unit::TestCase
- Defined in:
- lib/clearance/shoulda_macros.rb
Instance Method Summary collapse
- #assert_confirmation_error(model, attribute, message = "confirmation error") ⇒ Object
- #bad_confirmation_options(attribute) ⇒ Object
- #blank_confirmation_options(attribute) ⇒ Object
- #sign_in ⇒ Object
- #sign_in_as(user) ⇒ Object
- #sign_out ⇒ Object
Instance Method Details
#assert_confirmation_error(model, attribute, message = "confirmation error") ⇒ Object
242 243 244 245 246 |
# File 'lib/clearance/shoulda_macros.rb', line 242 def assert_confirmation_error(model, attribute, = "confirmation error") warn "[DEPRECATION] assert_confirmation_error: not meant to be public, no longer used internally" assert model.errors[attribute].include?("doesn't match confirmation"), end |
#bad_confirmation_options(attribute) ⇒ Object
236 237 238 239 240 |
# File 'lib/clearance/shoulda_macros.rb', line 236 def (attribute) warn "[DEPRECATION] bad_confirmation_options: not meant to be public, no longer used internally" opts = { attribute => attribute.to_s } opts.merge("#{attribute}_confirmation".to_sym => "not_#{attribute}") end |
#blank_confirmation_options(attribute) ⇒ Object
230 231 232 233 234 |
# File 'lib/clearance/shoulda_macros.rb', line 230 def (attribute) warn "[DEPRECATION] blank_confirmation_options: not meant to be public, no longer used internally" opts = { attribute => attribute.to_s } opts.merge("#{attribute}_confirmation".to_sym => "") end |
#sign_in ⇒ Object
222 223 224 |
# File 'lib/clearance/shoulda_macros.rb', line 222 def sign_in sign_in_as Factory(:email_confirmed_user) end |
#sign_in_as(user) ⇒ Object
217 218 219 220 |
# File 'lib/clearance/shoulda_macros.rb', line 217 def sign_in_as(user) @controller.current_user = user return user end |
#sign_out ⇒ Object
226 227 228 |
# File 'lib/clearance/shoulda_macros.rb', line 226 def sign_out @controller.current_user = nil end |