1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-15 15:18:14 +09:00
mastodon/spec/controllers/api/web/settings_controller_spec.rb

25 lines
537 B
Ruby
Raw Normal View History

# 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