diff --git a/app/models/hearing_day.rb b/app/models/hearing_day.rb index f20b2d367ea..76df6df34b1 100644 --- a/app/models/hearing_day.rb +++ b/app/models/hearing_day.rb @@ -293,7 +293,7 @@ def combine_time_and_date(time, timezone, date) # Method to get the associated conference link records if they exist and if not create new ones def find_or_create_conference_link! if FeatureToggle.enabled?(:pexip_conference_service) - PexipConferenceLink.find_or_create_by!(hearing_day: self) + PexipConferenceLink.find_or_create_by!(hearing_day: self, created_by: created_by) end end diff --git a/spec/jobs/virtual_hearings/create_conference_job_spec.rb b/spec/jobs/virtual_hearings/create_conference_job_spec.rb index 2d6d62d8481..df03c2b95fe 100644 --- a/spec/jobs/virtual_hearings/create_conference_job_spec.rb +++ b/spec/jobs/virtual_hearings/create_conference_job_spec.rb @@ -262,10 +262,7 @@ repkey: appeal.vacols_id ) end - let(:hearing) do - RequestStore[:current_user] = current_user - create(:legacy_hearing, appeal: appeal) - end + let(:hearing) { create(:legacy_hearing, appeal: appeal) } context "when representative is different in VACOLS and VBMS" do it "uses the representative in VBMS" do diff --git a/spec/models/hearing_day_spec.rb b/spec/models/hearing_day_spec.rb index 5ce3387c0d5..72e7a426c4c 100644 --- a/spec/models/hearing_day_spec.rb +++ b/spec/models/hearing_day_spec.rb @@ -584,40 +584,6 @@ def format_begins_at_from_db(time_string, scheduled_for) end end - context "hearing day is in future, link already exists and its created_by user differs \ - from that of the hearing day's" do - let(:user_1) { User.create(css_id: "user_1", station_id: 101) } - let(:user_2) { User.create(css_id: "user_2", station_id: 101) } - - let(:hearing_day) do - create( - :hearing_day, - request_type: HearingDay::REQUEST_TYPES[:video], - scheduled_for: 1.month.from_now, - regional_office: "RO01", - created_by: user_1, - room: "1" - ) - end - - let!(:preexisting_conference_link) do - PexipConferenceLink.create!( - hearing_day: hearing_day, - created_by: user_2 - ) - end - - subject { hearing_day.conference_link } - - it "A new link is NOT created" do - subject - - expect( - ConferenceLink.where(hearing_day: hearing_day).count - ).to eq 1 - end - end - context "hearing day in the future, conference link doesnt exist" do let(:hearing_day) do RequestStore[:current_user] = User.create(css_id: "BVASCASPER1", station_id: 101)