mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-29 19:40:23 -05:00
25 lines
542 B
Ruby
25 lines
542 B
Ruby
|
# 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(:success)
|
||
|
expect(user_web_setting.data['onboarded']).to eq('true')
|
||
|
end
|
||
|
|
||
|
def user_web_setting
|
||
|
Web::Setting.where(user: user).first
|
||
|
end
|
||
|
end
|
||
|
end
|