Fix specs

This commit is contained in:
Klaus Zanders
2026-03-06 10:34:42 +01:00
parent 396d899dc3
commit 15a41d2957
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -378,10 +378,10 @@ RSpec.describe MyController do
expect(response).to render_template "working_hours"
end
it "assigns @current_working_hours and @working_hours" do
it "assigns @current_working_hours and @past_working_hours" do
subject
expect(assigns(:current_working_hours)).to eq(user_working_hours)
expect(assigns(:working_hours)).to eq([user_working_hours])
expect(assigns(:past_working_hours)).to eq([user_working_hours])
end
end
+1
View File
@@ -1153,6 +1153,7 @@ RSpec.describe User do
end
it "does not include weekend days within the range" do
week_with_saturday_and_sunday_as_weekend
expect(subject).not_to include(Date.new(year, 7, 12), Date.new(year, 7, 13))
end
end
@@ -60,11 +60,11 @@ RSpec.describe UserWorkingHours::UpdateService do
end
end
context "when the record has today as valid_from (already in effect)" do
context "when the record has today as valid_from (current schedule)" do
let(:working_hours) { create(:user_working_hours, user: target_user, valid_from: Date.current) }
it "is unsuccessful" do
expect(service_call).to be_failure
it "is successful because today's schedule is editable in place" do
expect(service_call).to be_success
end
end