mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-20 05:44:01 +00:00
Add examples based on errors seen in #317
This commit is contained in:
parent
095a00ef3d
commit
3ce1385b25
37
spec/controllers/settings/flavours_controller_spec.rb
Normal file
37
spec/controllers/settings/flavours_controller_spec.rb
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Settings::FlavoursController, type: :controller 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
|
Loading…
Reference in a new issue