Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamWFLee committed Oct 3, 2024
1 parent 6a7d003 commit 76bc8ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/epi_deploy/git_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def create_or_update_tag(name, commit = nil, push: true)

def create_or_update_branch(name, commit)
force_create_branch(name, commit)
self.push name, force: true, tags: false
self.push "refs/heads/#{name}", force: true, tags: false
end

def delete_branches(branches)
Expand Down
8 changes: 4 additions & 4 deletions spec/lib/epi_deploy/git_wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
it 'adds a new tag for the stage to the commit' do
expect(mocked_git).to receive(:push).with('origin', 'refs/tags/production', delete: true)
expect(mocked_git).to receive(:add_tag).with('production', commit, any_args)
expect(mocked_git).to receive(:push).with('origin', 'production')
expect(mocked_git).to receive(:push).with('origin', 'refs/tags/production')

subject.create_or_update_tag 'production', commit
end
end

describe '#create_or_update_branch' do
it 'creates or moves the branch to the commit' do
expect(Kernel).to receive(:system).with("git branch -f production #{commit}").and_return(true)
expect(mocked_git).to receive(:push).with('origin', 'production', force: true, tags: false)

expect(Kernel).to receive(:system).with("git branch -f refs/heads/production #{commit}").and_return(true)
expect(mocked_git).to receive(:push).with('origin', 'refs/heads/production', force: true, tags: false
)
subject.create_or_update_branch('production', commit)
end
end
Expand Down

0 comments on commit 76bc8ae

Please sign in to comment.