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
Jérome Perrin
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+11
-5
spec/support/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
describe
'#merged_to_root_ref?'
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
}
end
context
'not merged branch'
do
subject
{
repository
.
merged_to_root_ref?
(
'not-merged-branch'
)
}
it
{
is_expected
.
to
be_falsey
}
end
end
describe
'#can_be_merged?'
do
...
...
@@ -316,7 +322,7 @@ describe Repository, models: true do
subject
{
results
.
first
}
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
...
...
@@ -960,10 +966,10 @@ describe Repository, models: true do
context
'cherry-picking a merge commit'
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
'
)
expect
(
repository
.
blob_at_branch
(
'
master
'
,
'foo/bar/.gitkeep'
)).
not_to
be_nil
repository
.
cherry_pick
(
user
,
pickable_merge
,
'
improve/awesome
'
)
expect
(
repository
.
blob_at_branch
(
'
improve/awesome
'
,
'foo/bar/.gitkeep'
)).
not_to
be_nil
end
end
end
...
...
spec/support/test_env.rb
View file @
ff076d88
...
...
@@ -5,6 +5,8 @@ module TestEnv
# When developing the seed repository, comment out the branch you will modify.
BRANCH_SHA
=
{
'not-merged-branch'
=>
'b83d6e3'
,
'branch-merged'
=>
'498214d'
,
'empty-branch'
=>
'7efb185'
,
'ends-with.json'
=>
'98b0d8b'
,
'flatten-dir'
=>
'e56497b'
,
...
...
@@ -14,7 +16,7 @@ module TestEnv
'improve/awesome'
=>
'5937ac0'
,
'markdown'
=>
'0ed8c6c'
,
'lfs'
=>
'be93687'
,
'master'
=>
'
5937ac0
'
,
'master'
=>
'
b83d6e3
'
,
"'test'"
=>
'e56497b'
,
'orphaned-branch'
=>
'45127a9'
,
'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