Commit 92d51da2 authored by Matija Čupić's avatar Matija Čupić

Use actual repo instead of stubbing method

parent 78cee2c5
...@@ -48,10 +48,6 @@ describe Projects::PipelinesSettingsController do ...@@ -48,10 +48,6 @@ describe Projects::PipelinesSettingsController do
end end
context 'when the project repository is empty' do context 'when the project repository is empty' do
before do
allow_any_instance_of(Project).to receive(:empty_repo?).and_return(true)
end
it 'sets a warning flash' do it 'sets a warning flash' do
expect(subject).to set_flash[:warning] expect(subject).to set_flash[:warning]
end end
...@@ -64,9 +60,7 @@ describe Projects::PipelinesSettingsController do ...@@ -64,9 +60,7 @@ describe Projects::PipelinesSettingsController do
end end
context 'when the project repository is not empty' do context 'when the project repository is not empty' do
before do let(:project) { create(:project, :repository) }
allow_any_instance_of(Project).to receive(:empty_repo?).and_return(false)
end
it 'sets a success flash' do it 'sets a success flash' do
allow(CreatePipelineWorker).to receive(:perform_async).with(project.id, user.id, project.default_branch, :web, any_args) allow(CreatePipelineWorker).to receive(:perform_async).with(project.id, user.id, project.default_branch, :web, any_args)
......
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