0
0
Fork 0

Convert api/web/settings controller spec to request spec (#31606)

This commit is contained in:
Matt Jankowski 2024-08-27 03:42:35 -04:00 committed by GitHub
parent 14d7fe05d0
commit c09d232ee3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 41 additions and 24 deletions

View file

@ -1,24 +0,0 @@
# frozen_string_literal: true
require 'rails_helper'
describe Api::Web::SettingsController do
render_views
let!(:user) { Fabricate(:user) }
describe 'PATCH #update' do
it 'redirects to about page' do
sign_in(user)
patch :update, format: :json, params: { data: { 'onboarded' => true } }
user.reload
expect(response).to have_http_status(200)
expect(user_web_setting.data['onboarded']).to eq('true')
end
def user_web_setting
Web::Setting.where(user: user).first
end
end
end