Module: Clearance::Shoulda::Helpers

Included in:
Test::Unit::TestCase
Defined in:
lib/clearance/shoulda_macros.rb

Instance Method Summary collapse

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, message = "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"),
    message
end

#bad_confirmation_options(attribute) ⇒ Object



236
237
238
239
240
# File 'lib/clearance/shoulda_macros.rb', line 236

def bad_confirmation_options(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 blank_confirmation_options(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_inObject



222
223
224
# File 'lib/clearance/shoulda_macros.rb', line 222

def 
   Factory(:email_confirmed_user)
end

#sign_in_as(user) ⇒ Object



217
218
219
220
# File 'lib/clearance/shoulda_macros.rb', line 217

def (user)
  @controller.current_user = user
  return user
end

#sign_outObject



226
227
228
# File 'lib/clearance/shoulda_macros.rb', line 226

def sign_out
  @controller.current_user = nil
end