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
f48f9460
Commit
f48f9460
authored
Jan 10, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[QA] Retrieve the current user name and email
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
be855cc6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
12 deletions
+11
-12
qa/qa/resource/base.rb
qa/qa/resource/base.rb
+0
-4
qa/qa/resource/user.rb
qa/qa/resource/user.rb
+6
-3
qa/qa/specs/features/browser_ui/3_create/repository/user_views_raw_diff_patch_requests_spec.rb
...ate/repository/user_views_raw_diff_patch_requests_spec.rb
+5
-1
qa/spec/resource/base_spec.rb
qa/spec/resource/base_spec.rb
+0
-4
No files found.
qa/qa/resource/base.rb
View file @
f48f9460
...
...
@@ -126,10 +126,6 @@ module QA
mod
end
def
self
.
attributes_names
dynamic_attributes
.
instance_methods
(
false
).
sort
.
grep_v
(
/=$/
)
end
class
DSL
def
initialize
(
base
)
@base
=
base
...
...
qa/qa/resource/user.rb
View file @
f48f9460
...
...
@@ -6,9 +6,12 @@ module QA
module
Resource
class
User
<
Base
attr_reader
:unique_id
attr_writer
:username
,
:password
,
:name
,
:email
attr_writer
:username
,
:password
attr_accessor
:provider
,
:extern_uid
attribute
:name
attribute
:email
def
initialize
@unique_id
=
SecureRandom
.
hex
(
8
)
end
...
...
@@ -22,11 +25,11 @@ module QA
end
def
name
@name
||=
username
@name
||=
api_resource
&
.
dig
(
:name
)
||
username
end
def
email
@email
||=
"
#{
username
}
@example.com"
@email
||=
api_resource
&
.
dig
(
:email
)
||
"
#{
username
}
@example.com"
end
def
credentials_given?
...
...
qa/qa/specs/features/browser_ui/3_create/repository/user_views_raw_diff_patch_requests_spec.rb
View file @
f48f9460
...
...
@@ -39,11 +39,15 @@ module QA
end
it
'user views raw email patch'
do
user
=
Resource
::
User
.
fabricate_via_api!
do
|
user
|
user
.
username
=
Runtime
::
User
.
username
end
view_commit
Page
::
Project
::
Commit
::
Show
.
perform
(
&
:select_email_patches
)
expect
(
page
).
to
have_content
(
'From: Administrator <admin@example.com>'
)
expect
(
page
).
to
have_content
(
"From:
#{
user
.
name
}
<
#{
user
.
email
}
>"
)
expect
(
page
).
to
have_content
(
'Subject: [PATCH] Add second file'
)
expect
(
page
).
to
have_content
(
'diff --git a/second b/second'
)
end
...
...
qa/spec/resource/base_spec.rb
View file @
f48f9460
...
...
@@ -138,10 +138,6 @@ describe QA::Resource::Base do
describe
'.attribute'
do
include_context
'simple resource'
it
'appends new attribute'
do
expect
(
subject
.
attributes_names
).
to
eq
([
:no_block
,
:test
,
:web_url
])
end
context
'when the attribute is populated via a block'
do
it
'returns value from the block'
do
result
=
subject
.
fabricate!
(
resource:
resource
)
...
...
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