You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
542 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe Api::Web::SettingsController do
  4. render_views
  5. let!(:user) { Fabricate(:user) }
  6. describe 'PATCH #update' do
  7. it 'redirects to about page' do
  8. sign_in(user)
  9. patch :update, format: :json, params: { data: { 'onboarded' => true } }
  10. user.reload
  11. expect(response).to have_http_status(:success)
  12. expect(user_web_setting.data['onboarded']).to eq('true')
  13. end
  14. def user_web_setting
  15. Web::Setting.where(user: user).first
  16. end
  17. end
  18. end