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
1b683006
Commit
1b683006
authored
Sep 08, 2020
by
Eugenia Grieff
Committed by
Dmytro Zaporozhets (DZ)
Sep 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix project import data spec
We need a persisted user for the project because it is used in some specs
parent
81ff89a6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
ee/spec/models/project_import_data_spec.rb
ee/spec/models/project_import_data_spec.rb
+3
-3
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+2
-2
spec/helpers/storage_helper_spec.rb
spec/helpers/storage_helper_spec.rb
+3
-2
spec/models/namespace_spec.rb
spec/models/namespace_spec.rb
+3
-1
No files found.
ee/spec/models/project_import_data_spec.rb
View file @
1b683006
...
...
@@ -5,9 +5,11 @@ require 'spec_helper'
RSpec
.
describe
ProjectImportData
do
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:import_url
)
{
'ssh://example.com'
}
let
(
:import_data_attrs
)
{
{
auth_method:
'ssh_public_key'
}
}
let
(
:project
)
{
build
(
:project
,
:mirror
,
import_url:
import_url
,
import_data_attributes:
import_data_attrs
)
}
let
(
:project
)
{
build
(
:project
,
:mirror
,
creator:
user
,
import_url:
import_url
,
import_data_attributes:
import_data_attrs
)
}
subject
(
:import_data
)
{
project
.
import_data
}
...
...
@@ -33,8 +35,6 @@ RSpec.describe ProjectImportData do
end
describe
'#ssh_known_hosts_verified_by'
do
let
(
:user
)
{
project
.
owner
}
subject
{
import_data
.
ssh_known_hosts_verified_by
}
it
'is a user when ssh_known_hosts_verified_by_id is a valid id'
do
...
...
ee/spec/models/project_spec.rb
View file @
1b683006
...
...
@@ -270,11 +270,11 @@ RSpec.describe Project do
describe
'setting up a mirror'
do
context
'when new project'
do
it
'creates import_state and sets next_execution_timestamp to now'
do
project
=
build
(
:project
,
:mirror
)
project
=
build
(
:project
,
:mirror
,
creator:
create
(
:user
)
)
Timecop
.
freeze
do
expect
do
project
.
save
project
.
save
!
end
.
to
change
{
ProjectImportState
.
count
}.
by
(
1
)
expect
(
project
.
import_state
.
next_execution_timestamp
).
to
be_like_time
(
Time
.
current
)
...
...
spec/helpers/storage_helper_spec.rb
View file @
1b683006
...
...
@@ -22,11 +22,12 @@ RSpec.describe StorageHelper do
end
describe
"#storage_counters_details"
do
let
(
:namespace
)
{
create
:namespace
}
let
(
:project
)
do
let
_it_be
(
:namespace
)
{
create
(
:namespace
)
}
let
_it_be
(
:project
)
do
create
(
:project
,
namespace:
namespace
,
statistics:
build
(
:project_statistics
,
namespace:
namespace
,
repository_size:
10
.
kilobytes
,
wiki_size:
10
.
bytes
,
lfs_objects_size:
20
.
gigabytes
,
...
...
spec/models/namespace_spec.rb
View file @
1b683006
...
...
@@ -175,12 +175,13 @@ RSpec.describe Namespace do
end
describe
'.with_statistics'
do
let
(
:namespace
)
{
create
:namespace
}
let
_it_be
(
:namespace
)
{
create
(
:namespace
)
}
let
(
:project1
)
do
create
(
:project
,
namespace:
namespace
,
statistics:
build
(
:project_statistics
,
namespace:
namespace
,
repository_size:
101
,
wiki_size:
505
,
lfs_objects_size:
202
,
...
...
@@ -193,6 +194,7 @@ RSpec.describe Namespace do
create
(
:project
,
namespace:
namespace
,
statistics:
build
(
:project_statistics
,
namespace:
namespace
,
repository_size:
10
,
wiki_size:
50
,
lfs_objects_size:
20
,
...
...
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