logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

settings_controller_spec.rb (542B)


  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