闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
677 B

  1. require 'rails_helper'
  2. RSpec.describe Settings::ProfilesController, type: :controller do
  3. render_views
  4. before do
  5. @user = Fabricate(:user)
  6. sign_in @user, scope: :user
  7. end
  8. describe "GET #show" do
  9. it "returns http success" do
  10. get :show
  11. expect(response).to have_http_status(:success)
  12. end
  13. end
  14. describe 'PUT #update' do
  15. it 'updates the user profile' do
  16. account = Fabricate(:account, user: @user, display_name: 'Old name')
  17. put :update, params: { account: { display_name: 'New name' } }
  18. expect(account.reload.display_name).to eq 'New name'
  19. expect(response).to redirect_to(settings_profile_path)
  20. end
  21. end
  22. end