Add test for `static#webapp_manifest`
This commit is contained in:
parent
b3092d2070
commit
e11b222368
|
@ -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
|
Loading…
Reference in New Issue