summaryrefslogtreecommitdiff
path: root/spec/mailers/notify_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'sh-fix-issue-45152' into 'master'Grzegorz Bizon2018-04-101-2/+14
| | | | | | | Fix undefined method `one?` when pushing to an existing merge request Closes #45152 See merge request gitlab-org/gitlab-ce!18243
* Fix body of email when commits are pushed to an MRSean McGivern2018-04-031-0/+30
| | | | | This was sending the current user, which is the recipient! It should be the user who pushed the commits.
* Replace deprecated name_with_namespace with full_name in app and specDmitriy Zaporozhets2018-03-051-11/+11
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Resolve "group request membership mail with too long list of "To:""🙈 jacopo beschi 🙉2018-02-191-48/+22
|
* Enable RuboCop Style/RegexpLiteralTakuya Noguchi2018-02-011-1/+1
|
* Initial work to add notification reason to emailsMario de la Ossa2018-01-161-0/+49
| | | | | | | | | | | Adds `#build_notification_recipients` to `NotificationRecipientService` that returns the `NotificationRecipient` objects in order to be able to access the new attribute `reason`. This new attribute is used in the different notifier methods in order to add the reason as a header: `X-GitLab-NotificationReason`. Only the reason with the most priority gets sent.
* Replace '.team << [user, role]' with 'add_role(user)' in specs36782-replace-team-user-role-with-add_role-user-in-specsblackst0ne2017-12-221-4/+4
|
* Make discussion mail References all notes in the discussiontc-correct-email-in-reply-toToon Claes2017-12-131-0/+40
| | | | | | | | | When a note is part of a discussion, the email sent out will be `In-Reply-To` the previous note in that discussion. It also `References` all the previous notes in that discussion, and the original issue. Closes gitlab-org/gitlab-ce#36054.
* Stop calling #strip in a commit title in Notify specs40691-upgrade-rails-to-4-2-10Rémy Coutable2017-12-011-2/+2
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix image diff notes emailFelipe Artur2017-11-131-1/+19
|
* Don't show an "Unsubscribe" link in snippet comment notificationsRémy Coutable2017-10-091-231/+260
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Remove some empty lines from notify specsbackstage/gb/optimize-notification-specsGrzegorz Bizon2017-09-011-3/+0
|
* Optimize notification emails specsGrzegorz Bizon2017-09-011-63/+31
|
* Enable the RSpec/HookArgument cop and auto-correct offensesRobert Speicher2017-08-101-3/+3
|
* Change all `:empty_project` to `:project`rs-empty_project-defaultRobert Speicher2017-08-021-9/+9
|
* Create and use project path helpers that only need a project, no namespaceDouwe Maan2017-07-051-22/+21
|
* Correct RSpec/SingleLineHook cop offensesRobert Speicher2017-06-141-8/+29
|
* Bugfix: Always use the default language when generating emails.32748-emails-are-being-sent-with-the-wrong-languageRuben Davila2017-05-251-0/+9
| | | | | | There was a race condition issue when the application was generating an email and was using a language that was previously being used in other request.
* Backport of multiple_assignees_feature [ci skip]Valery Sizov2017-05-041-5/+5
|
* Auto-correct `RSpec/DescribedClass` violationsrs-described_class-cop-2Robert Speicher2017-05-011-41/+41
|
* Address review commentsDouwe Maan2017-04-051-6/+6
|
* Fix specsDouwe Maan2017-04-051-1/+1
|
* Add specsDouwe Maan2017-04-051-19/+123
|
* Better notification emails for notes and (diff) discussionsDouwe Maan2017-04-051-0/+2
|
* Don't use FFaker in factories, use sequences insteadRémy Coutable2017-04-031-2/+2
| | | | | | | FFaker can generate data that randomly break our test suite. This simplifies our factories and use sequences which are more predictive. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Use `:empty_project` where possible in mailer specsRobert Speicher2017-03-271-5/+10
|
* Combine redundant `it` blocks in Notify specRobert Speicher2017-03-211-231/+149
| | | | | | We perform a bunch of setup for most of these cases, and it didn't make sense to do an entirely new costly setup just to test a different string in the same body of the email we just generated in the last test.
* Add a new have_html_escaped_body_text that match an HTML-escaped text20121-add-a-new-have_html_escaped_body_text-matcherRémy Coutable2017-03-171-31/+32
| | | | | | | This solves transient failures when a text contains HTML-escapable characters such as `'`. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix intermittent spec failures in notify_spec.rbNick Thomas2017-03-141-111/+120
|
* Merge branch '24880-configurable-plaintext-emails' into 'master' Sean McGivern2016-11-291-0/+34
|\ | | | | | | | | | | | | Add setting to enable/disable HTML emails Closes #24880 See merge request !7749
| * Add new configuration setting to enable/disable HTML emails.24880-configurable-plaintext-emailsRuben Davila2016-11-281-0/+34
| | | | | | | | | | | | This new global setting will allow admins to specify if HTML emails should be sent or not, this is basically useful when system administrators want to save some disk space by avoiding emails in HTML format and using only the Plain Text version.
* | Fix spec styleSean McGivern2016-11-281-0/+1
| |
* | Tidy up text emailsSean McGivern2016-11-281-4/+4
| |
* | Clean up rubocop complainthhoopes2016-11-251-1/+1
| |
* | Add keyword arguments to truncated_diff methodhhoopes2016-11-251-7/+1
| | | | | | | | | | * Added keyword arguments to truncated_diff_lines method to allow for using highlighting or not (html templates vs. text) * Tweaked templates for consistency and format appropriateness
* | Change diff highlight/truncate for reusabilityhhoopes2016-11-251-1/+79
| | | | | | | | | | | | Previously the `truncated_diff_lines` method for outputting a discussion diff took in already highlighted lines, which meant it wasn't reuseable for truncating ANY lines. In the way it was used, it also meant that for any email truncation, the whole diff was being highlighted before being truncated, meaning wasted time highlighting lines that wouldn't even be used (granted, they were being memoized, so perhaps this wasn't that great of an issue). I refactored truncation away from highlighting, in order to truncate formatted diffs for text templates in email, using `>`s to designate each line, but otherwise retaining the parsing already done to create `diff_lines`. Additionally, while notes on merge requests or commits had already been tested, there was no existing test for notes on a diff on an MR or commit. Added mailer tests for such, and a unit test for truncating diff lines.
* | Add new template to handle both commit & mr noteshhoopes2016-11-251-17/+2
| | | | | | | | | | | | | | | | Currently comments on commits and merge requests do not require merge request- or commit-specific information, but can use the same template. Rather than change the method which calls the template, I opted to keep the templates separate and create a new template to highlight their identicality, while preserving the option to distinguish them from each other in the future. Also removed some of the inconsistencies between text and html email versions. Still needed is a text-only version of git diffs and testing.
* | Add diff hunks to notification emails on MRhhoopes2016-11-251-2/+17
|/ | | | | | Added diff hunks to notification emails of messages on merge requests. This provides code context to the note. Uses existing template for formatting a diff for email (from repository push notifications).
* Make access request specs explicitly enable or disable access requests as ↵Nick Thomas2016-11-111-5/+10
| | | | required
* Move spec/mailers/shared/notify.rb to spec/supportJared Ready2016-10-221-1/+0
|
* refactors tests because of gitlab-test repository changes20708-new-branch-is-immediatelly-tagged-as-mergedtiagonbotelho2016-10-111-1/+1
|
* override subject method in devise mailerFu Xu2016-10-031-1/+2
|
* move spec back into shared example `an email sent from GitLab`Fu Xu2016-10-031-7/+0
|
* stub config settings in specFu Xu2016-10-031-5/+2
|
* remove empty line at block body endFu Xu2016-10-031-1/+0
|
* create new test in `spec/mailers/notify_spec.rb`Fu Xu2016-10-031-0/+11
|
* Merge branch ↵Robert Speicher2016-10-021-24/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '21983-member-add_user-doesn-t-detect-existing-members-that-have-requested-access' into 'master' Resolve "`Member.add_user`doesn't detect existing members that have requested access" ## What does this MR do? This merge request handle the case when an access requester is added to a group or project (via the members page or the API). In `Member.add_user`, if an access requester already exists, we simply accept their request (and set the `created_by`, `access_level` and `expires_at` attributes if given). ## Are there points in the code the reviewer needs to double check? I've taken the opportunity to cleanup the whole `{Group,Project}Member.add_user*` methods since it was quite a mess. ## What are the relevant issue numbers? Closes #21983 See merge request !6393
| * Allow Member.add_user to handle access requestersRémy Coutable2016-09-281-24/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes include: - Ensure Member.add_user is not called directly when not necessary - New GroupMember.add_users_to_group to have the same abstraction level as for Project - Refactor Member.add_user to take a source instead of an array of members - Fix Rubocop offenses - Always use Project#add_user instead of project.team.add_user - Factorize users addition as members in Member.add_users_to_source - Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects - Destroy any requester before adding them as a member - Improve the way we handle access requesters in Member.add_user Instead of removing the requester and creating a new member, we now simply accepts their access request. This way, they will receive a "access request granted" email. - Fix error that was previously silently ignored - Stop raising when access level is invalid in Member, let Rails validation do their work Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Fix specs that requires an access requestRémy Coutable2016-09-221-2/+2
|/ | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix "Unsubscribe" link in notification emails that is triggered by anti-virusMaximiliano Perez Coto2016-09-201-5/+5
| | | | | | | | | * Created a force=true param that will continue with the previous behaviour of the unsubscribe method * Created a filter for not-logged users so they see a unsubsribe confirmation page * Added the List-Unsubscribe header on emails so the email client can display it on top