Commit Graph

91 Commits

Author SHA1 Message Date
Eileen M. Uchitelle cad13033fc
Merge pull request #37847 from pwim/action-mailbox-mail-ext-tests
Test extensions to Mail gem
2019-12-12 10:15:07 -05:00
George Claghorn 7d0327bbbf Track Active Storage variants in the database 2019-12-06 13:26:51 -05:00
Paul McMahon 40d63cee31 Test extensions to Mail gem
The from_address method is added to Mail::Message, but is not used
internally to ActionMailbox, nor tested (even implicitly). As it is part
of the public API, it feels important to at least have a basic test of
it.

Similarly, the x_original_to_addresses was only implicitly tested via
the recipients_addresses method. Given other similar methods are
explicitly tested, it feels like an oversight not to test it as well.

As the test introduced from_address didn't align with the naming of
RecipientsTest, I renamed it to the more generic AddressesTest.
2019-12-03 06:51:41 +09:00
glaszig de862deb29 Fix Action Mailbox ingress config example [ci skip] 2019-10-14 21:58:30 -04:00
Orien Madgwick 493edf044f Add bug tracker/documentation/mailing list URIs to the gemspecs 2019-10-11 20:47:19 -04:00
Takayuki Nakata 43081fae4c Fix typo a InboxMailbox -> an InboxMailbox [ci skip] 2019-10-03 14:27:35 +09:00
DmitryTsepelev e7f798c3f5 Allow configure services for individual attachments 2019-10-01 21:24:05 +03:00
Takayuki Nakata fffb2b2a11 Fix typo in ActionMailbox::InboundEmail::MessageId [ci skip]
- `a Active Storage` -> `an Active Storage`
- `which be uploaded` -> `which is uploaded`
2019-09-17 17:40:49 +09:00
Yasuo Honda c5e3c537a4 Ignore SQLite3 database files generated by parallel testing
Rails 6.0 introduces parallel testing and the default degree of parallelism is configured based on the number of CPU.
refer https://github.com/rails/rails/pull/34735 https://github.com/rails/rails/pull/31900

When any minitest executed under the OS where 2 or more CPU available,
SQLite 3 database files are not git-ignored.

Also updated other files which ignores SQLite database files.

* Steps to reproduce

```
$ git clone https://github.com/yahonda/rep_ignore_sqlite3_databases.git
$ cd rep_ignore_sqlite3_databases/
$ bin/rails test
$ git status
```

* Expected behavior:

- No `Untracked files:`

* Actual behavior:

- SQLite 3 database files appeared

```
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	db/test.sqlite3-0
	db/test.sqlite3-1
	db/test.sqlite3-2
	db/test.sqlite3-3
	db/test.sqlite3-4
	db/test.sqlite3-5

nothing added to commit but untracked files present (use "git add" to track)
$
```
2019-08-27 11:42:04 +00:00
Abhay Nikam 76ed911a91 Correct the assertion argument order 2019-08-08 00:06:34 +05:30
George Claghorn c2f197c775 Correct assertion argument order 2019-08-07 10:54:56 -04:00
Michael Herold ab34ed8acc Allow testing multipart emails in Action Mailbox
Allow passing a block to the create_inbound_email_from_mail and
receive_inbound_email_from_mail test helper methods.

When you wanted to test a multipart email -- for example, an email that
has both a plaintext part and an HTML part -- there wasn't a way to
easily build one without a pre-made fixture. By allowing you to pass a
block to these methods, we unlock the power of Mail.new to easily
create a variety of emails, from multi-part emails, to emails with
attachments, and beyond.
2019-08-07 10:12:13 -04:00
Akira Matsuda af2129b4c7 Use `try` only when we're unsure if the receiver would respond_to the method 2019-08-01 17:58:00 +09:00
Akira Matsuda 0d981a2b3d Let the generated initializers/backtrace_silencers.rb code use Regexp#match? 2019-07-29 14:21:30 +09:00
John Duff 09e5d6d004 Fix Bcc header missing with emails from conductor and test helpers 2019-07-26 13:04:16 -04:00
George Claghorn 72bc0806a7 Correct assertion argument order 2019-07-25 22:34:40 -04:00
Kyle Keesling ce88f6bd25
Fix filenames of attachments created via the inbound email conductor
controller passed along attachment file paths instead of their filenames
2019-07-25 21:11:29 -04:00
yuuji.yaginuma 74e38da810 Test against all sent attributes 2019-06-23 10:33:29 +09:00
yuuji.yaginuma aab9f6734d Include BCC in the mail that sent from the development page
The BCC should be included as we show input field for BCC in view.
bf625f7fec/actionmailbox/app/views/rails/conductor/action_mailbox/inbound_emails/new.html.erb (L21-L24)
2019-06-20 14:09:01 +09:00
Ryuta Kamizono cc27e9988f Unify to use 4 spaces indentation in CHANGELOGs [ci skip]
Especially, somehow `CHANGELOG.md` in actiontext and activestorage in
master branch had used 3 spaces indentation.
2019-06-05 05:53:49 +09:00
yuuji.yaginuma d380ffe216 Remove `frozen_string_literal` magic comment from template file
The other template files do not add `frozen_string_literal`, so should
behave the same.

Ref: #30342, #30348.
2019-05-29 08:00:59 +09:00
James Dabbs 937f7d582e Add CHANGELOG entry 2019-05-09 13:34:21 -07:00
James Dabbs 9ce8156c93 Delegate to the correct method in `ActionMailbox.mailbox_for` 2019-05-05 12:09:32 -07:00
James Dabbs 80af2c5831 Rename variable to represent type
per comments from CR
2019-05-05 10:29:31 -07:00
James Dabbs 9f96d094a3 Expose `mailbox_for` method
Currently, the only exposed entry point into the ApplicationMailbox's configured
routing system is to call `route`, which performs a lot of work to fully
`process` inbound email. It'd be nice to have a way (e.g. in test) of checking
which mailbox an email would route to without necessarily processing it yet.
2019-05-04 10:53:08 -07:00
Rafael Mendonça França 9834be6565
Start Rails 6.1 development 2019-04-24 15:57:14 -04:00
George Claghorn f480cfabcd
Remove the Amazon SES ingress
It's unusable and not ready to ship in Rails 6.0. We'll rewrite it for 6.1.
2019-04-14 12:15:54 -04:00
yuuji.yaginuma 1b2f1735e7 Fix loading `ActionMailbox::BaseController` when CSRF protection is disabled
When `default_protect_from_forgery` is false, `verify_authenticity_token`
callback does not define and `skip_forgery_protection` raise exception.

Fixes #34837.
2019-04-11 18:25:09 +09:00
Kyle Zhao 4a9f2a746e FIX: ActionMailbox test helper argument list
`receive_inbound_email_from_source` should accept an argument list
(`*args`) instead, to allow for the `source` argument in
`create_inbound_email_from_source`.

```ruby
receive_inbound_email_from_source(source, status: :processing)
```

Accepting a keyword argument list (`**kwargs`) results in an
`ArgumentError`

```text
ArgumentError: wrong number of arguments (given 1, expected 0)
```
2019-04-09 00:43:53 -04:00
Fumiaki MATSUSHIMA 61c4be4777 Output junit format test report 2019-04-04 14:34:46 +09:00
Ryuta Kamizono b89a3e7e63 Tweaks CHANGELOGs and docs [ci skip]
* add leading `#` before `=>` since hash rocket is valid Ruby code
* add backticks
* remove trailing spaces
* and more
2019-03-31 08:38:37 +09:00
eileencodes c932850ef2 Add secret token for action mailbox tests
We need to create a secret token in the application so that the travis
build doesn't error when trying to create a file in the tmp directory.

Fixes https://travis-ci.org/rails/rails/jobs/505908163#L6811
2019-03-13 16:35:24 -04:00
eileencodes a2bd669ed2 v6.0.0.beta3 release
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEEvJkGf0BARV+D0L2ulxXUSC76N8FAlyJN4cACgkQulxXUSC7
 6N9ZXAf/Wx7edIct8kZzcC6irlROx4DzpNbrrH792sO1OAcnoFDE7DPkokllTEP/
 4kzC42lca/XG27MCl7E0dtVD8hIyAl89nxid6cwKFVZVTPIRVc1wjXkoiWy/cvd7
 6+9IjxhlgrzxGnw3aWZJG7H3iqz69yr55aoSDU/TbMqq5kQrqNF95vr2nc8LEUco
 SLQj0pO/tfJdHquSeX0JiXn3VSEHT+5TdLGQ3J/w0wFU6mkecH4MJMJvMwLFx/v4
 llnvF6HyfSLASWbrpdD3h6MQHpImDoee5vILXAHzPdSaEVcVa1cDFtMcPMYiu8Dw
 AGdCAaHQhZFFGoYK472+o6pur0dxEA==
 =5dET
 -----END PGP SIGNATURE-----

Merge tag 'v6.0.0.beta3'

v6.0.0.beta3 release
2019-03-13 13:11:10 -04:00
eileencodes 7c87fd5635 Prep release
* Update RAILS_VERSION
* Bundle
* rake update_versions
* rake changelog:header
2019-03-11 11:58:15 -04:00
Ryuta Kamizono b7fa01bb2f
Merge pull request #35529 from abhaynikam/35492-follow-up-to-updates-links-to-https
Updated links from http to https in guides, docs, etc
2019-03-09 20:49:27 +09:00
Abhay Nikam 476abd403b Updated links from http to https in guides, docs, etc 2019-03-09 16:43:47 +05:30
Sharang Dashputre bf87dae202 Upgrade webpack-dev-server version in test apps 2019-03-09 03:35:22 +05:30
Sharang Dashputre 8eaffa1945 Use the latest stable release of webpacker 2019-03-09 00:14:17 +05:30
Rafael Mendonça França 5e6e505083
Preparing for 6.0.0.beta2 release 2019-02-25 17:45:04 -05:00
George Claghorn ef602f8892 Fix preparing the configured Action Mailbox ingress in production
When reloading is disabled, after_initialize hooks run after to_prepare hooks have already run for the last time. Since to_prepare hooks always run after application initializers, we don't need need to use an after_initialize hook.
2019-02-18 11:50:50 -05:00
Ryuta Kamizono da5843436b SQLite3: Implement `add_foreign_key` and `remove_foreign_key`
I implemented Foreign key create in `create_table` for SQLite3 at
#24743. This follows #24743 to implement `add_foreign_key` and
`remove_foreign_key`.
Unfortunately SQLite3 has one limitation that
`PRAGMA foreign_key_list(table-name)` doesn't have constraint name.
So we couldn't implement find/remove foreign key by name for now.

Fixes #35207.
Closes #31343.
2019-02-11 14:15:16 +09:00
Pratik d0037daa37 Allow skipping incineration of processed emails 2019-02-06 19:28:49 -05:00
Ryuta Kamizono 1745e905a3 Allow changing text and blob size without giving the `limit` option
In MySQL, the text column size is 65,535 bytes by default (1 GiB in
PostgreSQL). It is sometimes too short when people want to use a text
column, so they sometimes change the text size to mediumtext (16 MiB) or
longtext (4 GiB) by giving the `limit` option.

Unlike MySQL, PostgreSQL doesn't allow the `limit` option for a text
column (raises ERROR: type modifier is not allowed for type "text").
So `limit: 4294967295` (longtext) couldn't be used in Action Text.

I've allowed changing text and blob size without giving the `limit`
option, it prevents that migration failure on PostgreSQL.
2019-01-29 06:49:32 +09:00
Ryuta Kamizono b8baa15adb Revert "Apply `t.timestamps` changes in Action Text and Action Mailbox"
This reverts commit 30f666f87a.
2019-01-29 06:37:42 +09:00
Ryuta Kamizono 30f666f87a Apply `t.timestamps` changes in Action Text and Action Mailbox
Follow up #34956.
2019-01-29 04:59:36 +09:00
Ryuta Kamizono 57015cdfa2 Make `t.timestamps` with precision by default 2019-01-26 22:49:14 +09:00
alkesh26 97909ddcf2 Changed webserver to web server. 2019-01-22 21:11:03 +05:30
alkesh26 b8e0333845 enclosing body tag in conductor layout. 2019-01-20 00:58:06 +05:30
George Claghorn aac4d7f6ff Check all provided attributes of the message 2019-01-19 11:49:50 -05:00
Yuichi Takeuchi 88453093d5 Fix that adding attachments lose a body 2019-01-19 23:28:41 +09:00