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
Léo-Paul Géneau
gitlab-ce
Commits
7a916e12
Commit
7a916e12
authored
Mar 10, 2018
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace project graphs spinach tests with RSpec analog
https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
parent
47b9854d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
83 deletions
+75
-83
features/project/graph.feature
features/project/graph.feature
+0
-33
features/steps/project/graph.rb
features/steps/project/graph.rb
+0
-50
spec/features/projects/graph_spec.rb
spec/features/projects/graph_spec.rb
+75
-0
No files found.
features/project/graph.feature
deleted
100644 → 0
View file @
47b9854d
Feature
:
Project Graph
Background
:
Given
I sign in as a user
And
I own project
"Shop"
@javascript
Scenario
:
I
should see project graphs
When
I visit project
"Shop"
graph page
Then
page should have graphs
@javascript
Scenario
:
I
should see project languages & commits graphs on commits graph url
When
I visit project
"Shop"
commits graph page
Then
page should have commits graphs
Then
page should have languages graphs
@javascript
Scenario
:
I
should see project ci graphs
Given
project
"Shop"
has CI enabled
When
I visit project
"Shop"
CI graph page
Then
page should have CI graphs
@javascript
Scenario
:
I
should see project languages & commits graphs on language graph url
When
I visit project
"Shop"
languages graph page
Then
page should have languages graphs
Then
page should have commits graphs
@javascript
Scenario
:
I
should see project languages & commits graphs on charts url
When
I visit project
"Shop"
chart page
Then
page should have languages graphs
Then
page should have commits graphs
features/steps/project/graph.rb
deleted
100644 → 0
View file @
47b9854d
class
Spinach::Features::ProjectGraph
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
step
'page should have graphs'
do
expect
(
page
).
to
have_selector
".stat-graph"
end
When
'I visit project "Shop" graph page'
do
visit
project_graph_path
(
project
,
"master"
)
end
step
'I visit project "Shop" commits graph page'
do
visit
commits_project_graph_path
(
project
,
"master"
)
end
step
'I visit project "Shop" languages graph page'
do
visit
languages_project_graph_path
(
project
,
"master"
)
end
step
'I visit project "Shop" chart page'
do
visit
charts_project_graph_path
(
project
,
"master"
)
end
step
'page should have languages graphs'
do
expect
(
page
).
to
have_content
/Ruby 66.* %/
expect
(
page
).
to
have_content
/JavaScript 22.* %/
end
step
'page should have commits graphs'
do
expect
(
page
).
to
have_content
"Commit statistics for master"
expect
(
page
).
to
have_content
"Commits per day of month"
end
step
'I visit project "Shop" CI graph page'
do
visit
ci_project_graph_path
(
project
,
'master'
)
end
step
'page should have CI graphs'
do
expect
(
page
).
to
have_content
'Overall'
expect
(
page
).
to
have_content
'Pipelines for last week'
expect
(
page
).
to
have_content
'Pipelines for last month'
expect
(
page
).
to
have_content
'Pipelines for last year'
expect
(
page
).
to
have_content
'Commit duration in minutes for last 30 commits'
end
def
project
@project
||=
Project
.
find_by
(
name:
"Shop"
)
end
end
spec/features/projects/graph_spec.rb
0 → 100644
View file @
7a916e12
require
'spec_helper'
describe
'Project Graph'
,
:js
do
let
(
:user
)
{
create
:user
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
before
do
project
.
add_master
(
user
)
sign_in
(
user
)
end
shared_examples
'page should have commits graphs'
do
it
'renders commits'
do
expect
(
page
).
to
have_content
(
'Commit statistics for master'
)
expect
(
page
).
to
have_content
(
'Commits per day of month'
)
end
end
shared_examples
'page should have languages graphs'
do
it
'renders languages'
do
expect
(
page
).
to
have_content
(
/Ruby 66.* %/
)
expect
(
page
).
to
have_content
(
/JavaScript 22.* %/
)
end
end
it
'renders graphs'
do
visit
project_graph_path
(
project
,
'master'
)
expect
(
page
).
to
have_selector
(
'.stat-graph'
,
visible:
false
)
end
context
'commits graph'
do
before
do
visit
commits_project_graph_path
(
project
,
'master'
)
end
it_behaves_like
'page should have commits graphs'
it_behaves_like
'page should have languages graphs'
end
context
'languages graph'
do
before
do
visit
languages_project_graph_path
(
project
,
'master'
)
end
it_behaves_like
'page should have commits graphs'
it_behaves_like
'page should have languages graphs'
end
context
'charts graph'
do
before
do
visit
charts_project_graph_path
(
project
,
'master'
)
end
it_behaves_like
'page should have commits graphs'
it_behaves_like
'page should have languages graphs'
end
context
'when CI enabled'
do
before
do
project
.
enable_ci
visit
ci_project_graph_path
(
project
,
'master'
)
end
it
'renders CI graphs'
do
expect
(
page
).
to
have_content
'Overall'
expect
(
page
).
to
have_content
'Pipelines for last week'
expect
(
page
).
to
have_content
'Pipelines for last month'
expect
(
page
).
to
have_content
'Pipelines for last year'
expect
(
page
).
to
have_content
'Commit duration in minutes for last 30 commits'
end
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