Test theme color in web app manifest
This commit is contained in:
parent
e11b222368
commit
5e4819764a
|
@ -59,6 +59,23 @@ describe StaticController, type: :controller do
|
||||||
expect(body["name"]).to eq("Specspring")
|
expect(body["name"]).to eq("Specspring")
|
||||||
expect(body["start_url"]).to eq("http://test.host/?source=pwa")
|
expect(body["start_url"]).to eq("http://test.host/?source=pwa")
|
||||||
expect(body["scope"]).to eq("http://test.host/")
|
expect(body["scope"]).to eq("http://test.host/")
|
||||||
|
expect(body["theme_color"]).to eq("#5e35b1")
|
||||||
|
end
|
||||||
|
|
||||||
|
context "user with a theme is logged in" do
|
||||||
|
let(:user) { FactoryBot.create(:user) }
|
||||||
|
let!(:theme) { FactoryBot.create(:theme, user: user) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
sign_in(user)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "uses the user's theme" do
|
||||||
|
subject
|
||||||
|
expect(response).to have_http_status(200)
|
||||||
|
body = JSON.parse(response.body)
|
||||||
|
expect(body["theme_color"]).to eq("#8e8cd8")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue