adds test for update_file method

This commit is contained in:
tiagonbotelho 2016-07-18 14:53:27 +01:00
parent 2e021c4e17
commit c6097f24d3
1 changed files with 14 additions and 0 deletions

View File

@ -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 }