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
Jérome Perrin
gitlab-ce
Commits
e49fb264
Commit
e49fb264
authored
Nov 04, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for deployment and environment entitites
parent
3968b07d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
spec/serializers/deployment_entity_spec.rb
spec/serializers/deployment_entity_spec.rb
+20
-0
spec/serializers/environment_entity_spec.rb
spec/serializers/environment_entity_spec.rb
+18
-0
No files found.
spec/serializers/deployment_entity_spec.rb
0 → 100644
View file @
e49fb264
require
'spec_helper'
describe
DeploymentEntity
do
let
(
:entity
)
do
described_class
.
new
(
deployment
,
request:
double
)
end
let
(
:deployment
)
{
create
(
:deployment
)
}
subject
{
entity
.
as_json
}
it
'exposes internal deployment id'
do
expect
(
subject
).
to
include
(
:iid
)
end
it
'exposes nested information about branch'
do
expect
(
subject
[
:ref
][
:name
]).
to
eq
'master'
expect
(
subject
[
:ref
][
:ref_url
]).
not_to
be_empty
end
end
spec/serializers/environment_entity_spec.rb
0 → 100644
View file @
e49fb264
require
'spec_helper'
describe
EnvironmentEntity
do
let
(
:entity
)
do
described_class
.
new
(
environment
,
request:
double
)
end
let
(
:environment
)
{
create
(
:environment
)
}
subject
{
entity
.
as_json
}
it
'exposes latest deployment'
do
expect
(
subject
).
to
include
(
:last_deployment
)
end
it
'exposes core elements of environment'
do
expect
(
subject
).
to
include
(
:id
,
:name
,
:state
,
:environment_url
)
end
end
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