Add test for `static#webapp_manifest`

This commit is contained in:
Karina Kwiatek 2022-07-11 16:26:04 +02:00 committed by Karina Kwiatek
parent b3092d2070
commit e11b222368
1 changed files with 23 additions and 0 deletions

View File

@ -38,4 +38,27 @@ describe StaticController, type: :controller do
end
end
end
describe "#webapp_manifest" do
subject { get :webapp_manifest }
before do
stub_const("APP_CONFIG", {
"site_name" => "Specspring",
"hostname" => "test.host",
"https" => false,
"items_per_page" => 5,
})
end
it "returns a web app manifest" do
subject
expect(response).to have_http_status(200)
body = JSON.parse(response.body)
expect(body["name"]).to eq("Specspring")
expect(body["start_url"]).to eq("http://test.host/?source=pwa")
expect(body["scope"]).to eq("http://test.host/")
end
end
end