diff --git a/spec/controllers/static_controller_spec.rb b/spec/controllers/static_controller_spec.rb index 426b37bf..e124fb3f 100644 --- a/spec/controllers/static_controller_spec.rb +++ b/spec/controllers/static_controller_spec.rb @@ -59,6 +59,23 @@ describe StaticController, type: :controller do 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/") + 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 \ No newline at end of file