Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
dbff2df7
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
dbff2df7
编写于
7月 15, 2020
作者:
B
Benoit Tigeot
提交者:
GitHub
7月 15, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Action Mailbox bug report templates
上级
b4ae6d0e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
149 addition
and
0 deletion
+149
-0
guides/bug_report_templates/action_mailbox_gem.rb
guides/bug_report_templates/action_mailbox_gem.rb
+75
-0
guides/bug_report_templates/action_mailbox_master.rb
guides/bug_report_templates/action_mailbox_master.rb
+74
-0
未找到文件。
guides/bug_report_templates/action_mailbox_gem.rb
0 → 100644
浏览文件 @
dbff2df7
# frozen_string_literal: true
require
"bundler/inline"
gemfile
(
true
)
do
source
"https://rubygems.org"
git_source
(
:github
)
{
|
repo
|
"https://github.com/
#{
repo
}
.git"
}
# Activate the gem you are reporting the issue against.
gem
"rails"
,
"6.0.3"
gem
"sqlite3"
end
require
"active_record/railtie"
require
"active_storage/engine"
require
"action_mailbox/engine"
require
"tmpdir"
class
TestApp
<
Rails
::
Application
config
.
root
=
__dir__
config
.
hosts
<<
"example.org"
config
.
eager_load
=
false
config
.
session_store
:cookie_store
,
key:
"cookie_store_key"
secrets
.
secret_key_base
=
"secret_key_base"
config
.
logger
=
Logger
.
new
(
$stdout
)
Rails
.
logger
=
config
.
logger
config
.
active_storage
.
service
=
:local
config
.
active_storage
.
service_configurations
=
{
local:
{
root:
Dir
.
tmpdir
,
service:
"Disk"
}
}
config
.
action_mailbox
.
ingress
=
:relay
end
ENV
[
"DATABASE_URL"
]
=
"sqlite3::memory:"
Rails
.
application
.
initialize!
require
ActiveStorage
::
Engine
.
root
.
join
(
"db/migrate/20170806125915_create_active_storage_tables.rb"
).
to_s
require
ActionMailbox
::
Engine
.
root
.
join
(
"db/migrate/20180917164000_create_action_mailbox_tables.rb"
).
to_s
ActiveRecord
::
Schema
.
define
do
CreateActiveStorageTables
.
new
.
change
CreateActionMailboxTables
.
new
.
change
end
class
ApplicationMailbox
<
ActionMailbox
::
Base
routing
(
/^replies@/i
)
=>
:replies
end
class
RepliesMailbox
<
ActionMailbox
::
Base
def
process
$processed
=
mail
.
subject
end
end
require
"minitest/autorun"
class
RepliesMailboxTest
<
ActionMailbox
::
TestCase
setup
do
$processed
=
false
@inbound_email
=
receive_inbound_email_from_mail
\
to:
"replies@example.com"
,
subject:
"Here is a reply"
end
test
"successful mailbox processing"
do
assert_equal
"Here is a reply"
,
$processed
end
end
guides/bug_report_templates/action_mailbox_master.rb
0 → 100644
浏览文件 @
dbff2df7
# frozen_string_literal: true
require
"bundler/inline"
gemfile
(
true
)
do
source
"https://rubygems.org"
git_source
(
:github
)
{
|
repo
|
"https://github.com/
#{
repo
}
.git"
}
gem
"rails"
,
github:
"rails/rails"
gem
"sqlite3"
end
require
"active_record/railtie"
require
"active_storage/engine"
require
"action_mailbox/engine"
require
"tmpdir"
class
TestApp
<
Rails
::
Application
config
.
root
=
__dir__
config
.
hosts
<<
"example.org"
config
.
eager_load
=
false
config
.
session_store
:cookie_store
,
key:
"cookie_store_key"
secrets
.
secret_key_base
=
"secret_key_base"
config
.
logger
=
Logger
.
new
(
$stdout
)
Rails
.
logger
=
config
.
logger
config
.
active_storage
.
service
=
:local
config
.
active_storage
.
service_configurations
=
{
local:
{
root:
Dir
.
tmpdir
,
service:
"Disk"
}
}
config
.
action_mailbox
.
ingress
=
:relay
end
ENV
[
"DATABASE_URL"
]
=
"sqlite3::memory:"
Rails
.
application
.
initialize!
require
ActiveStorage
::
Engine
.
root
.
join
(
"db/migrate/20170806125915_create_active_storage_tables.rb"
).
to_s
require
ActionMailbox
::
Engine
.
root
.
join
(
"db/migrate/20180917164000_create_action_mailbox_tables.rb"
).
to_s
ActiveRecord
::
Schema
.
define
do
CreateActiveStorageTables
.
new
.
change
CreateActionMailboxTables
.
new
.
change
end
class
ApplicationMailbox
<
ActionMailbox
::
Base
routing
(
/^replies@/i
)
=>
:replies
end
class
RepliesMailbox
<
ActionMailbox
::
Base
def
process
$processed
=
mail
.
subject
end
end
require
"minitest/autorun"
class
RepliesMailboxTest
<
ActionMailbox
::
TestCase
setup
do
$processed
=
false
@inbound_email
=
receive_inbound_email_from_mail
\
to:
"replies@example.com"
,
subject:
"Here is a reply"
end
test
"successful mailbox processing"
do
assert_equal
"Here is a reply"
,
$processed
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录