mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Fix specs
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user