diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-08-23 16:51:21 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-08-23 16:51:21 +0300 |
commit | 140ac8d2ad81f03f67dddcb565458e9baee79755 (patch) | |
tree | d1403d9f02eb8d4ffa6b91d4c7f51606c13a3078 /spec/models/project_spec.rb | |
parent | 5f811894a8ba0d85298cc695c360f171d30c193c (diff) |
Add changelog and tests
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 2e613c44357..130c0739033 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1563,10 +1563,18 @@ describe Project do describe 'project import state transitions' do context 'state transition: [:started] => [:finished]' do - let(:housekeeping_service) { spy } + let(:cleanup_service) { spy(:cleanup_service) } + let(:housekeeping_service) { spy(:housekeeping_service) } before do - allow(Projects::HousekeepingService).to receive(:new) { housekeeping_service } + allow(Projects::ImportExport::CleanupService) + .to receive(:new) { cleanup_service } + + allow(cleanup_service) + .to receive(:execute) { housekeeping_service.execute } + + allow(Projects::HousekeepingService) + .to receive(:new) { housekeeping_service } end it 'resets project import_error' do @@ -1581,6 +1589,7 @@ describe Project do project.import_finish + expect(cleanup_service).to have_received(:execute) expect(housekeeping_service).to have_received(:execute) end |