Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
1dd66061
Commit
1dd66061
authored
Jun 22, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send project transfer email to all members. Added specs for project move email
parent
dc0f08f8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
6 deletions
+24
-6
app/mailers/emails/projects.rb
app/mailers/emails/projects.rb
+4
-4
app/models/project.rb
app/models/project.rb
+2
-2
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+18
-0
No files found.
app/mailers/emails/projects.rb
View file @
1dd66061
...
...
@@ -8,10 +8,10 @@ module Emails
end
def
project_was_moved_email
(
user_project
_id
)
@user
s_project
=
UsersProject
.
find
user_project
_id
@project
=
@users_project
.
project
mail
(
to:
@user
s_project
.
user
.
email
,
def
project_was_moved_email
(
project_id
,
user
_id
)
@user
=
User
.
find
user
_id
@project
=
Project
.
find
project_id
mail
(
to:
@user
.
email
,
subject:
subject
(
"project was moved"
))
end
end
...
...
app/models/project.rb
View file @
1dd66061
...
...
@@ -246,8 +246,8 @@ class Project < ActiveRecord::Base
end
def
send_move_instructions
self
.
users_projects
.
each
do
|
memb
er
|
Notify
.
delay
.
project_was_moved_email
(
memb
er
.
id
)
team
.
members
.
each
do
|
us
er
|
Notify
.
delay
.
project_was_moved_email
(
self
.
id
,
us
er
.
id
)
end
end
...
...
spec/mailers/notify_spec.rb
View file @
1dd66061
...
...
@@ -218,6 +218,24 @@ describe Notify do
end
end
describe
'project was moved'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
)
}
it
'has the correct subject'
do
should
have_subject
/project was moved/
end
it
'contains name of project'
do
should
have_body_text
/
#{
project
.
name_with_namespace
}
/
end
it
'contains new user role'
do
should
have_body_text
/
#{
project
.
ssh_url_to_repo
}
/
end
end
describe
'project access changed'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment