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
Boxiang Sun
gitlab-ce
Commits
90f45e76
Commit
90f45e76
authored
Jun 25, 2018
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CE-EE parity for spec/models/repository_spec.rb
parent
eb0416ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+29
-7
No files found.
spec/models/repository_spec.rb
View file @
90f45e76
...
@@ -46,7 +46,7 @@ describe Repository do
...
@@ -46,7 +46,7 @@ describe Repository do
it
{
is_expected
.
not_to
include
(
'feature'
)
}
it
{
is_expected
.
not_to
include
(
'feature'
)
}
it
{
is_expected
.
not_to
include
(
'fix'
)
}
it
{
is_expected
.
not_to
include
(
'fix'
)
}
describe
'when storage is broken'
,
:broken_storage
do
describe
'when storage is broken'
,
:broken_storage
do
it
'should raise a storage error'
do
it
'should raise a storage error'
do
expect_to_raise_storage_error
do
expect_to_raise_storage_error
do
broken_repository
.
branch_names_contains
(
sample_commit
.
id
)
broken_repository
.
branch_names_contains
(
sample_commit
.
id
)
...
@@ -192,7 +192,7 @@ describe Repository do
...
@@ -192,7 +192,7 @@ describe Repository do
it
{
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
}
it
{
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
}
describe
'when storage is broken'
,
:broken_storage
do
describe
'when storage is broken'
,
:broken_storage
do
it
'should raise a storage error'
do
it
'should raise a storage error'
do
expect_to_raise_storage_error
do
expect_to_raise_storage_error
do
broken_repository
.
last_commit_id_for_path
(
sample_commit
.
id
,
'.gitignore'
)
broken_repository
.
last_commit_id_for_path
(
sample_commit
.
id
,
'.gitignore'
)
...
@@ -226,7 +226,7 @@ describe Repository do
...
@@ -226,7 +226,7 @@ describe Repository do
is_expected
.
to
eq
(
'c1acaa5'
)
is_expected
.
to
eq
(
'c1acaa5'
)
end
end
describe
'when storage is broken'
,
:broken_storage
do
describe
'when storage is broken'
,
:broken_storage
do
it
'should raise a storage error'
do
it
'should raise a storage error'
do
expect_to_raise_storage_error
do
expect_to_raise_storage_error
do
broken_repository
.
last_commit_for_path
(
sample_commit
.
id
,
'.gitignore'
).
id
broken_repository
.
last_commit_for_path
(
sample_commit
.
id
,
'.gitignore'
).
id
...
@@ -391,7 +391,7 @@ describe Repository do
...
@@ -391,7 +391,7 @@ describe Repository do
it_behaves_like
'finding commits by message'
it_behaves_like
'finding commits by message'
end
end
describe
'when storage is broken'
,
:broken_storage
do
describe
'when storage is broken'
,
:broken_storage
do
it
'should raise a storage error'
do
it
'should raise a storage error'
do
expect_to_raise_storage_error
{
broken_repository
.
find_commits_by_message
(
's'
)
}
expect_to_raise_storage_error
{
broken_repository
.
find_commits_by_message
(
's'
)
}
end
end
...
@@ -695,7 +695,7 @@ describe Repository do
...
@@ -695,7 +695,7 @@ describe Repository do
expect
(
results
).
to
match_array
([])
expect
(
results
).
to
match_array
([])
end
end
describe
'when storage is broken'
,
:broken_storage
do
describe
'when storage is broken'
,
:broken_storage
do
it
'should raise a storage error'
do
it
'should raise a storage error'
do
expect_to_raise_storage_error
do
expect_to_raise_storage_error
do
broken_repository
.
search_files_by_content
(
'feature'
,
'master'
)
broken_repository
.
search_files_by_content
(
'feature'
,
'master'
)
...
@@ -744,7 +744,7 @@ describe Repository do
...
@@ -744,7 +744,7 @@ describe Repository do
expect
(
results
).
to
match_array
([])
expect
(
results
).
to
match_array
([])
end
end
describe
'when storage is broken'
,
:broken_storage
do
describe
'when storage is broken'
,
:broken_storage
do
it
'should raise a storage error'
do
it
'should raise a storage error'
do
expect_to_raise_storage_error
{
broken_repository
.
search_files_by_name
(
'files'
,
'master'
)
}
expect_to_raise_storage_error
{
broken_repository
.
search_files_by_name
(
'files'
,
'master'
)
}
end
end
...
@@ -796,7 +796,7 @@ describe Repository do
...
@@ -796,7 +796,7 @@ describe Repository do
describe
'#fetch_ref'
do
describe
'#fetch_ref'
do
let
(
:broken_repository
)
{
create
(
:project
,
:broken_storage
).
repository
}
let
(
:broken_repository
)
{
create
(
:project
,
:broken_storage
).
repository
}
describe
'when storage is broken'
,
:broken_storage
do
describe
'when storage is broken'
,
:broken_storage
do
it
'should raise a storage error'
do
it
'should raise a storage error'
do
expect_to_raise_storage_error
do
expect_to_raise_storage_error
do
broken_repository
.
fetch_ref
(
broken_repository
,
source_ref:
'1'
,
target_ref:
'2'
)
broken_repository
.
fetch_ref
(
broken_repository
,
source_ref:
'1'
,
target_ref:
'2'
)
...
@@ -2294,6 +2294,28 @@ describe Repository do
...
@@ -2294,6 +2294,28 @@ describe Repository do
end
end
end
end
describe
'#local_branches'
do
it
'returns the local branches'
do
masterrev
=
repository
.
find_branch
(
'master'
).
dereferenced_target
create_remote_branch
(
'joe'
,
'remote_branch'
,
masterrev
)
repository
.
add_branch
(
user
,
'local_branch'
,
masterrev
.
id
)
expect
(
repository
.
local_branches
.
any?
{
|
branch
|
branch
.
name
==
'remote_branch'
}).
to
eq
(
false
)
expect
(
repository
.
local_branches
.
any?
{
|
branch
|
branch
.
name
==
'local_branch'
}).
to
eq
(
true
)
end
end
describe
'#remote_branches'
do
it
'returns the remote branches'
do
masterrev
=
repository
.
find_branch
(
'master'
).
dereferenced_target
create_remote_branch
(
'joe'
,
'remote_branch'
,
masterrev
)
repository
.
add_branch
(
user
,
'local_branch'
,
masterrev
.
id
)
expect
(
repository
.
remote_branches
(
'joe'
).
any?
{
|
branch
|
branch
.
name
==
'local_branch'
}).
to
eq
(
false
)
expect
(
repository
.
remote_branches
(
'joe'
).
any?
{
|
branch
|
branch
.
name
==
'remote_branch'
}).
to
eq
(
true
)
end
end
describe
'#commit_count'
do
describe
'#commit_count'
do
context
'with a non-existing repository'
do
context
'with a non-existing repository'
do
it
'returns 0'
do
it
'returns 0'
do
...
...
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