Skip to content

Commit 045b6cf

Browse files
CopilotGrantBirki
andcommitted
Fix linting issues and finalize test improvements
Co-authored-by: GrantBirki <[email protected]>
1 parent 9346f63 commit 045b6cf

File tree

6 files changed

+77
-77
lines changed

6 files changed

+77
-77
lines changed

spec/unit/lib/hooks/app/endpoints/health_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,38 @@ def app
2424

2525
it "includes health status in response" do
2626
get "/"
27-
27+
2828
response_data = JSON.parse(last_response.body)
2929
expect(response_data["status"]).to eq("healthy")
3030
end
3131

3232
it "includes timestamp in ISO8601 format" do
3333
get "/"
34-
34+
3535
response_data = JSON.parse(last_response.body)
3636
expect(response_data["timestamp"]).to eq(TIME_MOCK)
3737
end
3838

3939
it "includes version information" do
4040
get "/"
41-
41+
4242
response_data = JSON.parse(last_response.body)
4343
expect(response_data["version"]).to eq(Hooks::VERSION)
4444
end
4545

4646
it "includes uptime in seconds" do
4747
get "/"
48-
48+
4949
response_data = JSON.parse(last_response.body)
5050
expect(response_data["uptime_seconds"]).to be_a(Integer)
5151
expect(response_data["uptime_seconds"]).to eq(60) # 1 minute difference
5252
end
5353

5454
it "returns valid JSON structure" do
5555
get "/"
56-
56+
5757
expect { JSON.parse(last_response.body) }.not_to raise_error
58-
58+
5959
response_data = JSON.parse(last_response.body)
6060
expect(response_data).to have_key("status")
6161
expect(response_data).to have_key("timestamp")
@@ -67,11 +67,11 @@ def app
6767
# Test with different start time
6868
different_start = Time.parse("2024-12-31T23:58:30Z")
6969
allow(Hooks::App::API).to receive(:start_time).and_return(different_start)
70-
70+
7171
get "/"
72-
72+
7373
response_data = JSON.parse(last_response.body)
7474
expect(response_data["uptime_seconds"]).to eq(90) # 1.5 minutes difference
7575
end
7676
end
77-
end
77+
end

spec/unit/lib/hooks/app/endpoints/version_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,33 @@ def app
1919

2020
it "includes version number in response" do
2121
get "/"
22-
22+
2323
response_data = JSON.parse(last_response.body)
2424
expect(response_data["version"]).to eq(Hooks::VERSION)
2525
end
2626

2727
it "includes timestamp in ISO8601 format" do
2828
get "/"
29-
29+
3030
response_data = JSON.parse(last_response.body)
3131
expect(response_data["timestamp"]).to eq(TIME_MOCK)
3232
end
3333

3434
it "returns valid JSON structure" do
3535
get "/"
36-
36+
3737
expect { JSON.parse(last_response.body) }.not_to raise_error
38-
38+
3939
response_data = JSON.parse(last_response.body)
4040
expect(response_data).to have_key("version")
4141
expect(response_data).to have_key("timestamp")
4242
end
4343

4444
it "version matches expected format" do
4545
get "/"
46-
46+
4747
response_data = JSON.parse(last_response.body)
4848
expect(response_data["version"]).to match(/^\d+\.\d+\.\d+$/)
4949
end
5050
end
51-
end
51+
end

0 commit comments

Comments
 (0)