Skip to content

Commit

Permalink
Test doubles in correct format
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasdrga committed Sep 30, 2024
1 parent f87241e commit 21bd5b0
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions spec/jobs/metais/sync_project_events_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,13 @@
let(:latest_version) { double('LatestVersion', kod_metais: 'code1') }
let(:datahub_project) { instance_double(Datahub::Metais::Project, uuid: 'uuid1', latest_version: latest_version) }

let(:status_change) do
instance_double('Datahub::Metais::ProjectChange',
field: 'status',
created_at: Time.now,
new_value: 'new_status',
old_value: 'old_status')
end

let(:phase_change) do
instance_double('Datahub::Metais::ProjectChange',
field: 'faza_projektu',
created_at: Time.now,
new_value: 'new_phase',
old_value: 'old_phase')
end
let(:status_change) { instance_double(Datahub::Metais::ProjectChange, field: 'status', created_at: Time.now, new_value: 'new_status', old_value: 'old_status') }
let(:phase_change) { instance_double(Datahub::Metais::ProjectChange, field: 'faza_projektu', created_at: Time.now, new_value: 'new_phase', old_value: 'old_phase') }

let(:codelist_project_state_old) { instance_double('Datahub::Metais::CodelistProjectState', nazov: 'Old Status') }
let(:codelist_project_state_new) { instance_double('Datahub::Metais::CodelistProjectState', nazov: 'New Status') }
let(:codelist_project_phase_old) { instance_double('Datahub::Metais::CodelistProjectPhase', nazov: 'Old Phase') }
let(:codelist_project_phase_new) { instance_double('Datahub::Metais::CodelistProjectPhase', nazov: 'New Phase') }
let(:codelist_project_state_old) { instance_double(Datahub::Metais::CodelistProjectState, nazov: 'Old Status') }
let(:codelist_project_state_new) { instance_double(Datahub::Metais::CodelistProjectState, nazov: 'New Status') }
let(:codelist_project_phase_old) { instance_double(Datahub::Metais::CodelistProjectPhase, nazov: 'Old Phase') }
let(:codelist_project_phase_new) { instance_double(Datahub::Metais::CodelistProjectPhase, nazov: 'New Phase') }

before do
allow(Metais::OriginType).to receive(:find_by).with(name: 'MetaIS').and_return(origin_type)
Expand Down

0 comments on commit 21bd5b0

Please sign in to comment.