Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Remove created_by constraint" #23361

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/hearing_day.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions spec/jobs/virtual_hearings/create_conference_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 0 additions & 34 deletions spec/models/hearing_day_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading