Commit c6097f24 authored by tiagonbotelho's avatar tiagonbotelho

adds test for update_file method

parent 2e021c4e
......@@ -129,6 +129,20 @@ describe Repository, models: true do
end
end
describe :update_file do
it 'updates filename successfully' do
expect{repository.update_file(user, 'NEWLICENSE', 'Copyright!',
branch: 'master',
previous_path: 'LICENSE',
message: 'Changes filename')}.to change { repository.commits('master').count }.by(1)
files = repository.ls_files('master')
expect(files).not_to include('LICENSE')
expect(files).to include('NEWLICENSE')
end
end
describe "search_files" do
let(:results) { repository.search_files('feature', 'master') }
subject { results }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment