diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 15:07:12 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 15:07:12 +0200 |
| commit | 310ac404f25b412c5c1ead12247b4eb36e9f0025 (patch) | |
| tree | 6e1dcc5e1f85a483cef7044d341b7c940c1690a8 /internal/calfeed/json_test.go | |
| parent | 44472bbe31475a3c672ae003d928d7caffb4b50a (diff) | |
| parent | c5abf87fa7198c8f245f407774e2326e4b6c9b9c (diff) | |
| download | lectio-310ac404f25b412c5c1ead12247b4eb36e9f0025.tar.gz lectio-310ac404f25b412c5c1ead12247b4eb36e9f0025.zip | |
Merge branch 'engine-precedence-fixes': OF/EF calendar+readings flawlessness pass
Per-day validation vs litcal (OF) and missalemeum (EF) 2005-2050, all defects
fixed and re-validated to zero: OF calendar 0 real errors forward, OF readings
0 unresolvable, EF 0 reading gaps + resumed Sundays correct.
Diffstat (limited to 'internal/calfeed/json_test.go')
| -rw-r--r-- | internal/calfeed/json_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/calfeed/json_test.go b/internal/calfeed/json_test.go index d2bc856..aec3d14 100644 --- a/internal/calfeed/json_test.go +++ b/internal/calfeed/json_test.go @@ -3,6 +3,8 @@ package calfeed import ( "encoding/json" "testing" + + "github.com/lukaszkasprzak/lectio/internal/config" ) func TestJSONShape(t *testing.T) { @@ -33,3 +35,28 @@ func TestJSONShape(t *testing.T) { t.Fatalf("bad day: %s", b) } } + +// TestJSONCarriesSourceOffer pins the AGPL-3.0 ยง13 offer into the envelope. +// A consumer of /api/calendar.json may never load a single HTML page, so the +// footer link does not reach them -- the feed itself has to say where the +// source is. Dropping these fields is a licence-compliance regression, not a +// cosmetic one, which is why it is asserted rather than left to review. +func TestJSONCarriesSourceOffer(t *testing.T) { + b, err := JSON("new", nil) + if err != nil { + t.Fatal(err) + } + var out struct { + Source string `json:"source"` + License string `json:"license"` + } + if err := json.Unmarshal(b, &out); err != nil { + t.Fatal(err) + } + if out.Source != config.SourceURL { + t.Errorf("source = %q, want %q", out.Source, config.SourceURL) + } + if out.License != config.License { + t.Errorf("license = %q, want %q", out.License, config.License) + } +} |
