mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-27 20:51:36 +01:00
ff168ef202
* Run rubocop --autocorrect on app/, config/ and lib/, also manually fix some remaining style issues * Run rubocop --autocorrect-all on db/ * Run rubocop --autocorrect-all on `spec/` and fix remaining issues
39 lines
890 B
Ruby
39 lines
890 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe Settings::FlavoursController do
|
|
let(:user) { Fabricate(:user) }
|
|
|
|
before do
|
|
sign_in user, scope: :user
|
|
end
|
|
|
|
describe 'PUT #update' do
|
|
describe 'without a user[setting_skin] parameter' do
|
|
it 'sets the selected flavour' do
|
|
put :update, params: { flavour: 'schnozzberry' }
|
|
|
|
user.reload
|
|
|
|
expect(user.setting_flavour).to eq 'schnozzberry'
|
|
end
|
|
end
|
|
|
|
describe 'with a user[setting_skin] parameter' do
|
|
before do
|
|
put :update, params: { flavour: 'schnozzberry', user: { setting_skin: 'wallpaper' } }
|
|
|
|
user.reload
|
|
end
|
|
|
|
it 'sets the selected flavour' do
|
|
expect(user.setting_flavour).to eq 'schnozzberry'
|
|
end
|
|
|
|
it 'sets the selected skin' do
|
|
expect(user.setting_skin).to eq 'wallpaper'
|
|
end
|
|
end
|
|
end
|
|
end
|