BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
918646f8
Commit
918646f8
authored
Jun 23, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Project#new_issue_address(author):
Which would return the email address for creating a new issue by sending an email to that particular address.
parent
176fa21c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
project.rb
app/models/project.rb
+5
-0
project_spec.rb
spec/models/project_spec.rb
+16
-0
No files found.
app/models/project.rb
View file @
918646f8
...
@@ -528,6 +528,11 @@ class Project < ActiveRecord::Base
...
@@ -528,6 +528,11 @@ class Project < ActiveRecord::Base
web_url
.
split
(
'://'
)[
1
]
web_url
.
split
(
'://'
)[
1
]
end
end
def
new_issue_address
(
author
)
Gitlab
::
IncomingEmail
.
reply_address
(
"
#{
path_with_namespace
}
+
#{
author
.
authentication_token
}
"
)
end
def
build_commit_note
(
commit
)
def
build_commit_note
(
commit
)
notes
.
new
(
commit_id:
commit
.
id
,
noteable_type:
'Commit'
)
notes
.
new
(
commit_id:
commit
.
id
,
noteable_type:
'Commit'
)
end
end
...
...
spec/models/project_spec.rb
View file @
918646f8
...
@@ -129,6 +129,22 @@ describe Project, models: true do
...
@@ -129,6 +129,22 @@ describe Project, models: true do
end
end
end
end
describe
"#new_issue_address"
do
before
do
stub_incoming_email_setting
(
address:
"p+%{key}@gl.ab"
)
end
let
(
:project
)
{
create
(
:empty_project
,
path:
"somewhere"
)
}
let
(
:user
)
{
create
(
:user
)
}
it
'returns the address to create a new issue'
do
token
=
user
.
authentication_token
address
=
"p+
#{
project
.
namespace
.
path
}
/
#{
project
.
path
}
+
#{
token
}
@gl.ab"
expect
(
project
.
new_issue_address
(
user
)).
to
eq
(
address
)
end
end
describe
'last_activity methods'
do
describe
'last_activity methods'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:last_event
)
{
double
(
created_at:
Time
.
now
)
}
let
(
:last_event
)
{
double
(
created_at:
Time
.
now
)
}
...
...
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