class TestPasswordMailGenerator

Public Instance Methods

test_getpass_mail() click to toggle source
# File vendor/qwik/lib/qwik/act-getpass.rb, line 247
def test_getpass_mail
  res = session '/test/'

  # test_generate_password_mail
  t_make_public(Qwik::Action, :generate_password_mail)
  mail = @action.generate_password_mail 'user@e.com'
  eq({:from=>"test@q.example.com", :to=>"user@e.com",
       :subject=>"Your password: http://example.com",
       :content=>"This is your user name and password: http://example.com\n\nUsername:\tuser@e.com\nPassword:\t95988593\n\nPlease access login page http://example.com/test/.login\n\nYou can input the user name and password from this URL automatically.\nhttp://example.com/test/.login?user=user@e.com&pass=95988593\n"
     }, mail)

  @action.instance_eval {
    cf = @memory.catalog
    catalog = cf.get_catalog('ja')
    set_catalog(catalog)
  }

  mail = @action.generate_password_mail 'user@e.com'
  $KCODE = "s"
  eq({:from=>"test@q.example.com", :to=>"user@e.com",
       :subject=>"パスワード : http://example.com",
       :content=>"このサイトにおけるユーザ名とパスワードです : http://example.com\n\nユーザ名:\tuser@e.com\nパスワード:\t95988593\n\nログインページにアクセスしてください : http://example.com/test/.login\n\n下記URLにアクセスすると、自動的にユーザー名とパスワードを入力します。\nhttp://example.com/test/.login?user=user@e.com&pass=95988593\n"
     }, mail)
end
test_mail_example_org() click to toggle source
# File vendor/qwik/lib/qwik/act-getpass.rb, line 272
    def test_mail_example_org
      site = @site
      page = site.create '_SiteConfig'
      page.store(':siteurl: http://example.org/
:siteml: info@example.org
')

      res = session '/test/'
      ok_title 'Members Only'

      t_add_user
      res = session '/test/'
      ok_title 'FrontPage'

      t_make_public Qwik::Action, :generate_password_mail
      mail = @action.generate_password_mail 'user@e.com'
      eq({:from=>"info@example.org",
           :to=>"user@e.com",
           :subject=>"Your password: http://example.org",
           :content=>"This is your user name and password: http://example.org\n\nUsername:\tuser@e.com\nPassword:\t95988593\n\nPlease access login page http://example.org/.login\n\nYou can input the user name and password from this URL automatically.\nhttp://example.org/.login?user=user@e.com&pass=95988593\n"}, mail)
    end