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
0a69dbd2
Commit
0a69dbd2
authored
Dec 14, 2018
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-warnings' into 'master'
Fix warnings in tests See merge request gitlab-org/gitlab-ce!23788
parents
9f8e64e6
3c2a6be0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
22 deletions
+48
-22
spec/features/issues/user_creates_issue_spec.rb
spec/features/issues/user_creates_issue_spec.rb
+6
-4
spec/features/projects/labels/user_views_labels_spec.rb
spec/features/projects/labels/user_views_labels_spec.rb
+5
-3
spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb
...b/gitlab/background_migration/migrate_build_stage_spec.rb
+15
-5
spec/lib/gitlab/background_migration/migrate_stage_status_spec.rb
.../gitlab/background_migration/migrate_stage_status_spec.rb
+22
-10
No files found.
spec/features/issues/user_creates_issue_spec.rb
View file @
0a69dbd2
# frozen_string_literal: true
require
"spec_helper"
require
"spec_helper"
describe
"User creates issue"
do
describe
"User creates issue"
do
...
@@ -64,10 +66,10 @@ describe "User creates issue" do
...
@@ -64,10 +66,10 @@ describe "User creates issue" do
end
end
context
"with labels"
do
context
"with labels"
do
LABEL_TITLES
=
%w(bug feature enhancement)
.
freeze
let
(
:label_titles
)
{
%w(bug feature enhancement)
}
before
do
before
do
LABEL_TITLES
.
each
do
|
title
|
label_titles
.
each
do
|
title
|
create
(
:label
,
project:
project
,
title:
title
)
create
(
:label
,
project:
project
,
title:
title
)
end
end
end
end
...
@@ -77,13 +79,13 @@ describe "User creates issue" do
...
@@ -77,13 +79,13 @@ describe "User creates issue" do
fill_in
(
"Title"
,
with:
issue_title
)
fill_in
(
"Title"
,
with:
issue_title
)
click_button
(
"Label"
)
click_button
(
"Label"
)
click_link
(
LABEL_TITLES
.
first
)
click_link
(
label_titles
.
first
)
click_button
(
"Submit issue"
)
click_button
(
"Submit issue"
)
expect
(
page
).
to
have_content
(
issue_title
)
expect
(
page
).
to
have_content
(
issue_title
)
.
and
have_content
(
user
.
name
)
.
and
have_content
(
user
.
name
)
.
and
have_content
(
project
.
name
)
.
and
have_content
(
project
.
name
)
.
and
have_content
(
LABEL_TITLES
.
first
)
.
and
have_content
(
label_titles
.
first
)
end
end
end
end
end
end
...
...
spec/features/projects/labels/user_views_labels_spec.rb
View file @
0a69dbd2
# frozen_string_literal: true
require
"spec_helper"
require
"spec_helper"
describe
"User views labels"
do
describe
"User views labels"
do
set
(
:project
)
{
create
(
:project_empty_repo
,
:public
)
}
set
(
:project
)
{
create
(
:project_empty_repo
,
:public
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:user
)
{
create
(
:user
)
}
LABEL_TITLES
=
%w[bug enhancement feature]
.
freeze
let
(
:label_titles
)
{
%w[bug enhancement feature]
}
before
do
before
do
LABEL_TITLES
.
each
{
|
title
|
create
(
:label
,
project:
project
,
title:
title
)
}
label_titles
.
each
{
|
title
|
create
(
:label
,
project:
project
,
title:
title
)
}
project
.
add_guest
(
user
)
project
.
add_guest
(
user
)
sign_in
(
user
)
sign_in
(
user
)
...
@@ -17,7 +19,7 @@ describe "User views labels" do
...
@@ -17,7 +19,7 @@ describe "User views labels" do
it
"shows all labels"
do
it
"shows all labels"
do
page
.
within
(
'.other-labels .manage-labels-list'
)
do
page
.
within
(
'.other-labels .manage-labels-list'
)
do
LABEL_TITLES
.
each
{
|
title
|
expect
(
page
).
to
have_content
(
title
)
}
label_titles
.
each
{
|
title
|
expect
(
page
).
to
have_content
(
title
)
}
end
end
end
end
end
end
spec/lib/gitlab/background_migration/migrate_build_stage_spec.rb
View file @
0a69dbd2
...
@@ -6,8 +6,18 @@ describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 201
...
@@ -6,8 +6,18 @@ describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 201
let
(
:stages
)
{
table
(
:ci_stages
)
}
let
(
:stages
)
{
table
(
:ci_stages
)
}
let
(
:jobs
)
{
table
(
:ci_builds
)
}
let
(
:jobs
)
{
table
(
:ci_builds
)
}
STATUSES
=
{
created:
0
,
pending:
1
,
running:
2
,
success:
3
,
let
(
:statuses
)
do
failed:
4
,
canceled:
5
,
skipped:
6
,
manual:
7
}.
freeze
{
created:
0
,
pending:
1
,
running:
2
,
success:
3
,
failed:
4
,
canceled:
5
,
skipped:
6
,
manual:
7
}
end
before
do
before
do
projects
.
create!
(
id:
123
,
name:
'gitlab'
,
path:
'gitlab-ce'
)
projects
.
create!
(
id:
123
,
name:
'gitlab'
,
path:
'gitlab-ce'
)
...
@@ -36,9 +46,9 @@ describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 201
...
@@ -36,9 +46,9 @@ describe Gitlab::BackgroundMigration::MigrateBuildStage, :migration, schema: 201
expect
(
stages
.
all
.
pluck
(
:name
)).
to
match_array
%w[test build deploy]
expect
(
stages
.
all
.
pluck
(
:name
)).
to
match_array
%w[test build deploy]
expect
(
jobs
.
where
(
stage_id:
nil
)).
to
be_one
expect
(
jobs
.
where
(
stage_id:
nil
)).
to
be_one
expect
(
jobs
.
find_by
(
stage_id:
nil
).
id
).
to
eq
6
expect
(
jobs
.
find_by
(
stage_id:
nil
).
id
).
to
eq
6
expect
(
stages
.
all
.
pluck
(
:status
)).
to
match_array
[
STATUSES
[
:success
],
expect
(
stages
.
all
.
pluck
(
:status
)).
to
match_array
[
statuses
[
:success
],
STATUSES
[
:failed
],
statuses
[
:failed
],
STATUSES
[
:pending
]]
statuses
[
:pending
]]
end
end
it
'recovers from unique constraint violation only twice'
do
it
'recovers from unique constraint violation only twice'
do
...
...
spec/lib/gitlab/background_migration/migrate_stage_status_spec.rb
View file @
0a69dbd2
# frozen_string_literal: true
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
BackgroundMigration
::
MigrateStageStatus
,
:migration
,
schema:
20170711145320
do
describe
Gitlab
::
BackgroundMigration
::
MigrateStageStatus
,
:migration
,
schema:
20170711145320
do
...
@@ -6,8 +8,18 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
...
@@ -6,8 +8,18 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
let
(
:stages
)
{
table
(
:ci_stages
)
}
let
(
:stages
)
{
table
(
:ci_stages
)
}
let
(
:jobs
)
{
table
(
:ci_builds
)
}
let
(
:jobs
)
{
table
(
:ci_builds
)
}
STATUSES
=
{
created:
0
,
pending:
1
,
running:
2
,
success:
3
,
let
(
:statuses
)
do
failed:
4
,
canceled:
5
,
skipped:
6
,
manual:
7
}.
freeze
{
created:
0
,
pending:
1
,
running:
2
,
success:
3
,
failed:
4
,
canceled:
5
,
skipped:
6
,
manual:
7
}
end
before
do
before
do
projects
.
create!
(
id:
1
,
name:
'gitlab1'
,
path:
'gitlab1'
)
projects
.
create!
(
id:
1
,
name:
'gitlab1'
,
path:
'gitlab1'
)
...
@@ -26,8 +38,8 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
...
@@ -26,8 +38,8 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
it
'sets a correct stage status'
do
it
'sets a correct stage status'
do
described_class
.
new
.
perform
(
1
,
2
)
described_class
.
new
.
perform
(
1
,
2
)
expect
(
stages
.
first
.
status
).
to
eq
STATUSES
[
:running
]
expect
(
stages
.
first
.
status
).
to
eq
statuses
[
:running
]
expect
(
stages
.
second
.
status
).
to
eq
STATUSES
[
:failed
]
expect
(
stages
.
second
.
status
).
to
eq
statuses
[
:failed
]
end
end
end
end
...
@@ -35,8 +47,8 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
...
@@ -35,8 +47,8 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
it
'sets a skipped stage status'
do
it
'sets a skipped stage status'
do
described_class
.
new
.
perform
(
1
,
2
)
described_class
.
new
.
perform
(
1
,
2
)
expect
(
stages
.
first
.
status
).
to
eq
STATUSES
[
:skipped
]
expect
(
stages
.
first
.
status
).
to
eq
statuses
[
:skipped
]
expect
(
stages
.
second
.
status
).
to
eq
STATUSES
[
:skipped
]
expect
(
stages
.
second
.
status
).
to
eq
statuses
[
:skipped
]
end
end
end
end
...
@@ -50,8 +62,8 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
...
@@ -50,8 +62,8 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
it
'sets a correct stage status'
do
it
'sets a correct stage status'
do
described_class
.
new
.
perform
(
1
,
2
)
described_class
.
new
.
perform
(
1
,
2
)
expect
(
stages
.
first
.
status
).
to
eq
STATUSES
[
:canceled
]
expect
(
stages
.
first
.
status
).
to
eq
statuses
[
:canceled
]
expect
(
stages
.
second
.
status
).
to
eq
STATUSES
[
:success
]
expect
(
stages
.
second
.
status
).
to
eq
statuses
[
:success
]
end
end
end
end
...
@@ -65,8 +77,8 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
...
@@ -65,8 +77,8 @@ describe Gitlab::BackgroundMigration::MigrateStageStatus, :migration, schema: 20
it
'sets a correct stage status'
do
it
'sets a correct stage status'
do
described_class
.
new
.
perform
(
1
,
2
)
described_class
.
new
.
perform
(
1
,
2
)
expect
(
stages
.
first
.
status
).
to
eq
STATUSES
[
:manual
]
expect
(
stages
.
first
.
status
).
to
eq
statuses
[
:manual
]
expect
(
stages
.
second
.
status
).
to
eq
STATUSES
[
:success
]
expect
(
stages
.
second
.
status
).
to
eq
statuses
[
:success
]
end
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