2017-05-22 23:12:29 +02:00
|
|
|
# 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
|
2018-04-21 21:35:07 +02:00
|
|
|
expect(response).to have_http_status(200)
|
2017-05-22 23:12:29 +02:00
|
|
|
expect(user_web_setting.data['onboarded']).to eq('true')
|
|
|
|
end
|
|
|
|
|
|
|
|
def user_web_setting
|
|
|
|
Web::Setting.where(user: user).first
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|