BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ff076d88
Commit
ff076d88
authored
Sep 27, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
writes tests to verify the issue is solved and fixes breaking issues.
parent
2de8fc3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
repository_spec.rb
spec/models/repository_spec.rb
+11
-5
test_env.rb
spec/support/test_env.rb
+3
-1
No files found.
spec/models/repository_spec.rb
View file @
ff076d88
...
@@ -115,10 +115,16 @@ describe Repository, models: true do
...
@@ -115,10 +115,16 @@ describe Repository, models: true do
describe
'#merged_to_root_ref?'
do
describe
'#merged_to_root_ref?'
do
context
'merged branch'
do
context
'merged branch'
do
subject
{
repository
.
merged_to_root_ref?
(
'
improve/awesome
'
)
}
subject
{
repository
.
merged_to_root_ref?
(
'
branch-merged
'
)
}
it
{
is_expected
.
to
be_truthy
}
it
{
is_expected
.
to
be_truthy
}
end
end
context
'not merged branch'
do
subject
{
repository
.
merged_to_root_ref?
(
'not-merged-branch'
)
}
it
{
is_expected
.
to
be_falsey
}
end
end
end
describe
'#can_be_merged?'
do
describe
'#can_be_merged?'
do
...
@@ -316,7 +322,7 @@ describe Repository, models: true do
...
@@ -316,7 +322,7 @@ describe Repository, models: true do
subject
{
results
.
first
}
subject
{
results
.
first
}
it
{
is_expected
.
to
be_an
String
}
it
{
is_expected
.
to
be_an
String
}
it
{
expect
(
subject
.
lines
[
2
]).
to
eq
(
"master:CHANGELOG:1
88
: - Feature: Replace teams with group membership
\n
"
)
}
it
{
expect
(
subject
.
lines
[
2
]).
to
eq
(
"master:CHANGELOG:1
90
: - Feature: Replace teams with group membership
\n
"
)
}
end
end
end
end
...
@@ -960,10 +966,10 @@ describe Repository, models: true do
...
@@ -960,10 +966,10 @@ describe Repository, models: true do
context
'cherry-picking a merge commit'
do
context
'cherry-picking a merge commit'
do
it
'cherry-picks the changes'
do
it
'cherry-picks the changes'
do
expect
(
repository
.
blob_at_branch
(
'
master
'
,
'foo/bar/.gitkeep'
)).
to
be_nil
expect
(
repository
.
blob_at_branch
(
'
improve/awesome
'
,
'foo/bar/.gitkeep'
)).
to
be_nil
repository
.
cherry_pick
(
user
,
pickable_merge
,
'
master
'
)
repository
.
cherry_pick
(
user
,
pickable_merge
,
'
improve/awesome
'
)
expect
(
repository
.
blob_at_branch
(
'
master
'
,
'foo/bar/.gitkeep'
)).
not_to
be_nil
expect
(
repository
.
blob_at_branch
(
'
improve/awesome
'
,
'foo/bar/.gitkeep'
)).
not_to
be_nil
end
end
end
end
end
end
...
...
spec/support/test_env.rb
View file @
ff076d88
...
@@ -5,6 +5,8 @@ module TestEnv
...
@@ -5,6 +5,8 @@ module TestEnv
# When developing the seed repository, comment out the branch you will modify.
# When developing the seed repository, comment out the branch you will modify.
BRANCH_SHA
=
{
BRANCH_SHA
=
{
'not-merged-branch'
=>
'b83d6e3'
,
'branch-merged'
=>
'498214d'
,
'empty-branch'
=>
'7efb185'
,
'empty-branch'
=>
'7efb185'
,
'ends-with.json'
=>
'98b0d8b'
,
'ends-with.json'
=>
'98b0d8b'
,
'flatten-dir'
=>
'e56497b'
,
'flatten-dir'
=>
'e56497b'
,
...
@@ -14,7 +16,7 @@ module TestEnv
...
@@ -14,7 +16,7 @@ module TestEnv
'improve/awesome'
=>
'5937ac0'
,
'improve/awesome'
=>
'5937ac0'
,
'markdown'
=>
'0ed8c6c'
,
'markdown'
=>
'0ed8c6c'
,
'lfs'
=>
'be93687'
,
'lfs'
=>
'be93687'
,
'master'
=>
'
5937ac0
'
,
'master'
=>
'
b83d6e3
'
,
"'test'"
=>
'e56497b'
,
"'test'"
=>
'e56497b'
,
'orphaned-branch'
=>
'45127a9'
,
'orphaned-branch'
=>
'45127a9'
,
'binary-encoding'
=>
'7b1cf43'
,
'binary-encoding'
=>
'7b1cf43'
,
...
...
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