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
28f85155
Commit
28f85155
authored
Jul 18, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes rubocop issues and implements create_commit test
parent
50f3d0d4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
Gemfile.lock
Gemfile.lock
+0
-1
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+18
-2
No files found.
Gemfile.lock
View file @
28f85155
...
@@ -389,7 +389,6 @@ GEM
...
@@ -389,7 +389,6 @@ GEM
mail_room (0.8.0)
mail_room (0.8.0)
method_source (0.8.2)
method_source (0.8.2)
mime-types (2.99.2)
mime-types (2.99.2)
mime-types-data (3.2016.0521)
mimemagic (0.3.0)
mimemagic (0.3.0)
mini_portile2 (2.1.0)
mini_portile2 (2.1.0)
minitest (5.7.0)
minitest (5.7.0)
...
...
spec/models/repository_spec.rb
View file @
28f85155
...
@@ -129,12 +129,28 @@ describe Repository, models: true do
...
@@ -129,12 +129,28 @@ describe Repository, models: true do
end
end
end
end
describe
:create_file
do
it
'commits change to a file successfully'
do
expect
do
repository
.
commit_file
(
user
,
'LICENSE'
,
'Copyright!'
,
'Updates filename'
,
'master'
,
true
)
end
.
to
change
{
repository
.
commits
(
'master'
).
count
}.
by
(
1
)
blob
=
Blob
.
decorate
(
repository
.
blob_at
(
repository
.
commits
(
'master'
).
first
.
id
,
'LICENSE'
))
expect
(
blob
.
data
).
to
eq
(
'Copyright!'
)
end
end
describe
:update_file
do
describe
:update_file
do
it
'updates filename successfully'
do
it
'updates filename successfully'
do
expect
{
repository
.
update_file
(
user
,
'NEWLICENSE'
,
'Copyright!'
,
expect
do
repository
.
update_file
(
user
,
'NEWLICENSE'
,
'Copyright!'
,
branch:
'master'
,
branch:
'master'
,
previous_path:
'LICENSE'
,
previous_path:
'LICENSE'
,
message:
'Changes filename'
)}.
to
change
{
repository
.
commits
(
'master'
).
count
}.
by
(
1
)
message:
'Changes filename'
)
end
.
to
change
{
repository
.
commits
(
'master'
).
count
}.
by
(
1
)
files
=
repository
.
ls_files
(
'master'
)
files
=
repository
.
ls_files
(
'master'
)
...
...
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