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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4e7b47dd
Commit
4e7b47dd
authored
Sep 10, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert ci features specs to v3
parent
e5042137
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
87 additions
and
87 deletions
+87
-87
spec/features/ci/admin/builds_spec.rb
spec/features/ci/admin/builds_spec.rb
+11
-11
spec/features/ci/admin/events_spec.rb
spec/features/ci/admin/events_spec.rb
+2
-2
spec/features/ci/admin/projects_spec.rb
spec/features/ci/admin/projects_spec.rb
+1
-1
spec/features/ci/admin/runners_spec.rb
spec/features/ci/admin/runners_spec.rb
+7
-7
spec/features/ci/builds_spec.rb
spec/features/ci/builds_spec.rb
+8
-8
spec/features/ci/commits_spec.rb
spec/features/ci/commits_spec.rb
+20
-20
spec/features/ci/events_spec.rb
spec/features/ci/events_spec.rb
+2
-2
spec/features/ci/lint_spec.rb
spec/features/ci/lint_spec.rb
+6
-6
spec/features/ci/projects_spec.rb
spec/features/ci/projects_spec.rb
+13
-13
spec/features/ci/runners_spec.rb
spec/features/ci/runners_spec.rb
+9
-9
spec/features/ci/triggers_spec.rb
spec/features/ci/triggers_spec.rb
+3
-3
spec/features/ci/variables_spec.rb
spec/features/ci/variables_spec.rb
+2
-2
spec/support/stub_gitlab_calls.rb
spec/support/stub_gitlab_calls.rb
+3
-3
No files found.
spec/features/ci/admin/builds_spec.rb
View file @
4e7b47dd
...
...
@@ -16,8 +16,8 @@ describe "Admin Builds" do
visit
admin_builds_path
end
it
{
page
.
should
have_content
"All builds"
}
it
{
page
.
should
have_content
build
.
short_sha
}
it
{
expect
(
page
).
to
have_content
"All builds"
}
it
{
expect
(
page
).
to
have_content
build
.
short_sha
}
end
describe
"Tabs"
do
...
...
@@ -29,7 +29,7 @@ describe "Admin Builds" do
visit
admin_builds_path
page
.
all
(
".build-link"
).
size
.
should
==
4
expect
(
page
.
all
(
".build-link"
).
size
).
to
eq
(
4
)
end
it
"shows pending builds"
do
...
...
@@ -44,10 +44,10 @@ describe "Admin Builds" do
click_on
"Pending"
end
page
.
find
(
".build-link"
).
should
have_content
(
build
.
id
)
page
.
find
(
".build-link"
).
should_not
have_content
(
build1
.
id
)
page
.
find
(
".build-link"
).
should_not
have_content
(
build2
.
id
)
page
.
find
(
".build-link"
).
should_not
have_content
(
build3
.
id
)
expect
(
page
.
find
(
".build-link"
)).
to
have_content
(
build
.
id
)
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build1
.
id
)
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build2
.
id
)
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build3
.
id
)
end
it
"shows running builds"
do
...
...
@@ -62,10 +62,10 @@ describe "Admin Builds" do
click_on
"Running"
end
page
.
find
(
".build-link"
).
should
have_content
(
build1
.
id
)
page
.
find
(
".build-link"
).
should_not
have_content
(
build
.
id
)
page
.
find
(
".build-link"
).
should_not
have_content
(
build2
.
id
)
page
.
find
(
".build-link"
).
should_not
have_content
(
build3
.
id
)
expect
(
page
.
find
(
".build-link"
)).
to
have_content
(
build1
.
id
)
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build
.
id
)
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build2
.
id
)
expect
(
page
.
find
(
".build-link"
)).
not_to
have_content
(
build3
.
id
)
end
end
end
spec/features/ci/admin/events_spec.rb
View file @
4e7b47dd
...
...
@@ -14,7 +14,7 @@ describe "Admin Events" do
visit
admin_events_path
end
it
{
page
.
should
have_content
"Events"
}
it
{
page
.
should
have_content
event
.
description
}
it
{
expect
(
page
).
to
have_content
"Events"
}
it
{
expect
(
page
).
to
have_content
event
.
description
}
end
end
spec/features/ci/admin/projects_spec.rb
View file @
4e7b47dd
...
...
@@ -14,6 +14,6 @@ describe "Admin Projects" do
visit
admin_projects_path
end
it
{
page
.
should
have_content
"Projects"
}
it
{
expect
(
page
).
to
have_content
"Projects"
}
end
end
spec/features/ci/admin/runners_spec.rb
View file @
4e7b47dd
...
...
@@ -27,8 +27,8 @@ describe "Admin Runners" do
click_button
'Search'
end
it
{
page
.
should
have_content
(
"foo"
)
}
it
{
page
.
should_not
have_content
(
"bar"
)
}
it
{
expect
(
page
).
to
have_content
(
"foo"
)
}
it
{
expect
(
page
).
not_to
have_content
(
"bar"
)
}
end
end
...
...
@@ -42,12 +42,12 @@ describe "Admin Runners" do
end
describe
'runner info'
do
it
{
find_field
(
'runner_token'
).
value
.
should
eq
runner
.
token
}
it
{
expect
(
find_field
(
'runner_token'
).
value
).
to
eq
runner
.
token
}
end
describe
'projects'
do
it
{
page
.
should
have_content
(
"foo"
)
}
it
{
page
.
should
have_content
(
"bar"
)
}
it
{
expect
(
page
).
to
have_content
(
"foo"
)
}
it
{
expect
(
page
).
to
have_content
(
"bar"
)
}
end
describe
'search'
do
...
...
@@ -56,8 +56,8 @@ describe "Admin Runners" do
click_button
'Search'
end
it
{
page
.
should
have_content
(
"foo"
)
}
it
{
page
.
should_not
have_content
(
"bar"
)
}
it
{
expect
(
page
).
to
have_content
(
"foo"
)
}
it
{
expect
(
page
).
not_to
have_content
(
"bar"
)
}
end
end
end
spec/features/ci/builds_spec.rb
View file @
4e7b47dd
...
...
@@ -13,9 +13,9 @@ describe "Builds" do
visit
project_build_path
(
@project
,
@build
)
end
it
{
page
.
should
have_content
@commit
.
sha
[
0
..
7
]
}
it
{
page
.
should
have_content
@commit
.
git_commit_message
}
it
{
page
.
should
have_content
@commit
.
git_author_name
}
it
{
expect
(
page
).
to
have_content
@commit
.
sha
[
0
..
7
]
}
it
{
expect
(
page
).
to
have_content
@commit
.
git_commit_message
}
it
{
expect
(
page
).
to
have_content
@commit
.
git_author_name
}
end
describe
"GET /:project/builds/:id/cancel"
do
...
...
@@ -25,8 +25,8 @@ describe "Builds" do
visit
cancel_project_build_path
(
@project
,
@build
)
end
it
{
page
.
should
have_content
'canceled'
}
it
{
page
.
should
have_content
'Retry'
}
it
{
expect
(
page
).
to
have_content
'canceled'
}
it
{
expect
(
page
).
to
have_content
'Retry'
}
end
describe
"POST /:project/builds/:id/retry"
do
...
...
@@ -37,8 +37,8 @@ describe "Builds" do
click_link
'Retry'
end
it
{
page
.
should
have_content
'pending'
}
it
{
page
.
should
have_content
'Cancel'
}
it
{
expect
(
page
).
to
have_content
'pending'
}
it
{
expect
(
page
).
to
have_content
'Cancel'
}
end
describe
"Show page public accessible"
do
...
...
@@ -52,6 +52,6 @@ describe "Builds" do
visit
project_build_path
(
@project
,
@build
)
end
it
{
page
.
should
have_content
@commit
.
sha
[
0
..
7
]
}
it
{
expect
(
page
).
to
have_content
@commit
.
sha
[
0
..
7
]
}
end
end
spec/features/ci/commits_spec.rb
View file @
4e7b47dd
...
...
@@ -4,63 +4,63 @@ describe "Commits" do
context
"Authenticated user"
do
before
do
login_as
:user
@project
=
FactoryGirl
.
create
:project
@commit
=
FactoryGirl
.
create
:commit
,
project:
@project
@build
=
FactoryGirl
.
create
:build
,
commit:
@commit
@project
=
FactoryGirl
.
create
:
ci_
project
@commit
=
FactoryGirl
.
create
:c
i_c
ommit
,
project:
@project
@build
=
FactoryGirl
.
create
:
ci_
build
,
commit:
@commit
end
describe
"GET /:project/commits/:sha"
do
before
do
visit
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
visit
ci_
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
end
it
{
page
.
should
have_content
@commit
.
sha
[
0
..
7
]
}
it
{
page
.
should
have_content
@commit
.
git_commit_message
}
it
{
page
.
should
have_content
@commit
.
git_author_name
}
it
{
expect
(
page
).
to
have_content
@commit
.
sha
[
0
..
7
]
}
it
{
expect
(
page
).
to
have_content
@commit
.
git_commit_message
}
it
{
expect
(
page
).
to
have_content
@commit
.
git_author_name
}
end
describe
"Cancel commit"
do
it
"cancels commit"
do
visit
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
visit
ci_
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
click_on
"Cancel"
page
.
should
have_content
"canceled"
expect
(
page
).
to
have_content
"canceled"
end
end
describe
".gitlab-ci.yml not found warning"
do
it
"does not show warning"
do
visit
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
visit
ci_
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
page
.
should_not
have_content
".gitlab-ci.yml not found in this commit"
expect
(
page
).
not_to
have_content
".gitlab-ci.yml not found in this commit"
end
it
"shows warning"
do
@commit
.
push_data
[
:ci_yaml_file
]
=
nil
@commit
.
save
visit
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
visit
ci_
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
page
.
should
have_content
".gitlab-ci.yml not found in this commit"
expect
(
page
).
to
have_content
".gitlab-ci.yml not found in this commit"
end
end
end
context
"Public pages"
do
before
do
@project
=
FactoryGirl
.
create
:public_project
@commit
=
FactoryGirl
.
create
:commit
,
project:
@project
@build
=
FactoryGirl
.
create
:build
,
commit:
@commit
@project
=
FactoryGirl
.
create
:
ci_
public_project
@commit
=
FactoryGirl
.
create
:c
i_c
ommit
,
project:
@project
@build
=
FactoryGirl
.
create
:
ci_
build
,
commit:
@commit
end
describe
"GET /:project/commits/:sha"
do
before
do
visit
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
visit
ci_
project_ref_commit_path
(
@project
,
@commit
.
ref
,
@commit
.
sha
)
end
it
{
page
.
should
have_content
@commit
.
sha
[
0
..
7
]
}
it
{
page
.
should
have_content
@commit
.
git_commit_message
}
it
{
page
.
should
have_content
@commit
.
git_author_name
}
it
{
expect
(
page
).
to
have_content
@commit
.
sha
[
0
..
7
]
}
it
{
expect
(
page
).
to
have_content
@commit
.
git_commit_message
}
it
{
expect
(
page
).
to
have_content
@commit
.
git_author_name
}
end
end
end
spec/features/ci/events_spec.rb
View file @
4e7b47dd
...
...
@@ -14,7 +14,7 @@ describe "Events" do
visit
project_events_path
(
project
)
end
it
{
page
.
should
have_content
"Events"
}
it
{
page
.
should
have_content
event
.
description
}
it
{
expect
(
page
).
to
have_content
"Events"
}
it
{
expect
(
page
).
to
have_content
event
.
description
}
end
end
spec/features/ci/lint_spec.rb
View file @
4e7b47dd
...
...
@@ -11,10 +11,10 @@ describe "Lint" do
fill_in
"content"
,
with:
content
click_on
"Validate"
within
"table"
do
page
.
should
have_content
(
"Job - rspec"
)
page
.
should
have_content
(
"Job - spinach"
)
page
.
should
have_content
(
"Deploy Job - staging"
)
page
.
should
have_content
(
"Deploy Job - production"
)
expect
(
page
).
to
have_content
(
"Job - rspec"
)
expect
(
page
).
to
have_content
(
"Job - spinach"
)
expect
(
page
).
to
have_content
(
"Deploy Job - staging"
)
expect
(
page
).
to
have_content
(
"Deploy Job - production"
)
end
end
...
...
@@ -22,7 +22,7 @@ describe "Lint" do
visit
lint_path
fill_in
"content"
,
with:
""
click_on
"Validate"
page
.
should
have_content
(
"Status: syntax is incorrect"
)
page
.
should
have_content
(
"Error: Please provide content of .gitlab-ci.yml"
)
expect
(
page
).
to
have_content
(
"Status: syntax is incorrect"
)
expect
(
page
).
to
have_content
(
"Error: Please provide content of .gitlab-ci.yml"
)
end
end
spec/features/ci/projects_spec.rb
View file @
4e7b47dd
...
...
@@ -12,8 +12,8 @@ describe "Projects" do
visit
projects_path
end
it
{
page
.
should
have_content
"GitLab / gitlab-shell"
}
it
{
page
.
should
have_selector
".search input#search"
}
it
{
expect
(
page
).
to
have_content
"GitLab / gitlab-shell"
}
it
{
expect
(
page
).
to
have_selector
".search input#search"
}
end
describe
"GET /projects/:id"
do
...
...
@@ -21,8 +21,8 @@ describe "Projects" do
visit
project_path
(
@project
)
end
it
{
page
.
should
have_content
@project
.
name
}
it
{
page
.
should
have_content
'All commits'
}
it
{
expect
(
page
).
to
have_content
@project
.
name
}
it
{
expect
(
page
).
to
have_content
'All commits'
}
end
describe
"GET /projects/:id/edit"
do
...
...
@@ -30,16 +30,16 @@ describe "Projects" do
visit
edit_project_path
(
@project
)
end
it
{
page
.
should
have_content
@project
.
name
}
it
{
page
.
should
have_content
'Build Schedule'
}
it
{
expect
(
page
).
to
have_content
@project
.
name
}
it
{
expect
(
page
).
to
have_content
'Build Schedule'
}
it
"updates configuration"
do
fill_in
'Timeout'
,
with:
'70'
click_button
'Save changes'
page
.
should
have_content
'was successfully updated'
expect
(
page
).
to
have_content
'was successfully updated'
find_field
(
'Timeout'
).
value
.
should
eq
'70'
expect
(
find_field
(
'Timeout'
).
value
).
to
eq
'70'
end
end
...
...
@@ -48,10 +48,10 @@ describe "Projects" do
visit
project_charts_path
(
@project
)
end
it
{
page
.
should
have_content
'Overall'
}
it
{
page
.
should
have_content
'Builds chart for last week'
}
it
{
page
.
should
have_content
'Builds chart for last month'
}
it
{
page
.
should
have_content
'Builds chart for last year'
}
it
{
page
.
should
have_content
'Commit duration in minutes for last 30 commits'
}
it
{
expect
(
page
).
to
have_content
'Overall'
}
it
{
expect
(
page
).
to
have_content
'Builds chart for last week'
}
it
{
expect
(
page
).
to
have_content
'Builds chart for last month'
}
it
{
expect
(
page
).
to
have_content
'Builds chart for last year'
}
it
{
expect
(
page
).
to
have_content
'Commit duration in minutes for last 30 commits'
}
end
end
spec/features/ci/runners_spec.rb
View file @
4e7b47dd
...
...
@@ -12,7 +12,7 @@ describe "Runners" do
stub_js_gitlab_calls
# all projects should be authorized for user
Network
.
any_instance
.
stub
(
:projects
).
and_return
([
allow_any_instance_of
(
Network
).
to
receive
(
:projects
).
and_return
([
OpenStruct
.
new
({
id:
@project
.
gitlab_id
}),
OpenStruct
.
new
({
id:
@project2
.
gitlab_id
})
])
...
...
@@ -26,9 +26,9 @@ describe "Runners" do
it
"places runners in right places"
do
visit
project_runners_path
(
@project
)
page
.
find
(
".available-specific-runners"
).
should
have_content
(
@specific_runner2
.
display_name
)
page
.
find
(
".activated-specific-runners"
).
should
have_content
(
@specific_runner
.
display_name
)
page
.
find
(
".available-shared-runners"
).
should
have_content
(
@shared_runner
.
display_name
)
expect
(
page
.
find
(
".available-specific-runners"
)).
to
have_content
(
@specific_runner2
.
display_name
)
expect
(
page
.
find
(
".activated-specific-runners"
)).
to
have_content
(
@specific_runner
.
display_name
)
expect
(
page
.
find
(
".available-shared-runners"
)).
to
have_content
(
@shared_runner
.
display_name
)
end
it
"enables specific runner for project"
do
...
...
@@ -38,7 +38,7 @@ describe "Runners" do
click_on
"Enable for this project"
end
page
.
find
(
".activated-specific-runners"
).
should
have_content
(
@specific_runner2
.
display_name
)
expect
(
page
.
find
(
".activated-specific-runners"
)).
to
have_content
(
@specific_runner2
.
display_name
)
end
it
"disables specific runner for project"
do
...
...
@@ -50,7 +50,7 @@ describe "Runners" do
click_on
"Disable for this project"
end
page
.
find
(
".available-specific-runners"
).
should
have_content
(
@specific_runner
.
display_name
)
expect
(
page
.
find
(
".available-specific-runners"
)).
to
have_content
(
@specific_runner
.
display_name
)
end
it
"removes specific runner for project if this is last project for that runners"
do
...
...
@@ -60,7 +60,7 @@ describe "Runners" do
click_on
"Remove runner"
end
Runner
.
exists?
(
id:
@specific_runner
).
should
be_false
expect
(
Runner
.
exists?
(
id:
@specific_runner
)).
to
be_falsey
end
end
...
...
@@ -75,7 +75,7 @@ describe "Runners" do
click_on
"Enable shared runners"
@project
.
reload
.
shared_runners_enabled
.
should
be_true
expect
(
@project
.
reload
.
shared_runners_enabled
).
to
be_truthy
end
end
...
...
@@ -92,7 +92,7 @@ describe "Runners" do
click_on
@specific_runner
.
short_sha
page
.
should
have_content
(
@specific_runner
.
platform
)
expect
(
page
).
to
have_content
(
@specific_runner
.
platform
)
end
end
end
spec/features/ci/triggers_spec.rb
View file @
4e7b47dd
...
...
@@ -11,16 +11,16 @@ describe 'Variables' do
context
'create a trigger'
do
before
do
click_on
'Add Trigger'
@project
.
triggers
.
count
.
should
==
1
expect
(
@project
.
triggers
.
count
).
to
eq
(
1
)
end
it
'contains trigger token'
do
page
.
should
have_content
(
@project
.
triggers
.
first
.
token
)
expect
(
page
).
to
have_content
(
@project
.
triggers
.
first
.
token
)
end
it
'revokes the trigger'
do
click_on
'Revoke'
@project
.
triggers
.
count
.
should
==
0
expect
(
@project
.
triggers
.
count
).
to
eq
(
0
)
end
end
end
spec/features/ci/variables_spec.rb
View file @
4e7b47dd
...
...
@@ -18,8 +18,8 @@ describe "Variables" do
fill_in
"Value"
,
with:
"SECRET_VALUE"
click_on
"Save changes"
page
.
should
have_content
(
"Variables were successfully updated."
)
@project
.
variables
.
count
.
should
==
1
expect
(
page
).
to
have_content
(
"Variables were successfully updated."
)
expect
(
@project
.
variables
.
count
).
to
eq
(
1
)
end
end
...
...
spec/support/stub_gitlab_calls.rb
View file @
4e7b47dd
...
...
@@ -10,7 +10,7 @@ module StubGitlabCalls
end
def
stub_js_gitlab_calls
Network
.
any_instance
.
stub
(
:projects
)
{
project_hash_array
}
allow_any_instance_of
(
Network
).
to
receive
(
:projects
)
{
project_hash_array
}
end
private
...
...
@@ -42,12 +42,12 @@ module StubGitlabCalls
def
stub_project_8
data
=
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/project_8.json'
))
Network
.
any_instance
.
stub
(
:project
).
and_return
(
JSON
.
parse
(
data
))
allow_any_instance_of
(
Network
).
to
receive
(
:project
).
and_return
(
JSON
.
parse
(
data
))
end
def
stub_project_8_hooks
data
=
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/project_8_hooks.json'
))
Network
.
any_instance
.
stub
(
:project_hooks
).
and_return
(
JSON
.
parse
(
data
))
allow_any_instance_of
(
Network
).
to
receive
(
:project_hooks
).
and_return
(
JSON
.
parse
(
data
))
end
def
stub_projects
...
...
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