mirror of
				https://github.com/mastodon/mastodon.git
				synced 2025-10-31 05:11:33 +00:00 
			
		
		
		
	 4a9c49ee43
			
		
	
	
		4a9c49ee43
		
			
		
	
	
	
		
			
	
		
	
	
		
			Some checks are pending
		
		
	
	Check i18n / check-i18n (push) Waiting to run
				
			CodeQL / Analyze (javascript) (push) Waiting to run
				
			CodeQL / Analyze (ruby) (push) Waiting to run
				
			Check formatting / lint (push) Waiting to run
				
			Ruby Linting / lint (push) Waiting to run
				
			Historical data migration test / test (14-alpine) (push) Waiting to run
				
			Historical data migration test / test (15-alpine) (push) Waiting to run
				
			Historical data migration test / test (16-alpine) (push) Waiting to run
				
			Historical data migration test / test (17-alpine) (push) Waiting to run
				
			Ruby Testing / build (production) (push) Waiting to run
				
			Ruby Testing / build (test) (push) Waiting to run
				
			Ruby Testing / test (.ruby-version) (push) Blocked by required conditions
				
			Ruby Testing / test (3.2) (push) Blocked by required conditions
				
			Ruby Testing / test (3.3) (push) Blocked by required conditions
				
			Ruby Testing / Libvips tests (.ruby-version) (push) Blocked by required conditions
				
			Ruby Testing / Libvips tests (3.2) (push) Blocked by required conditions
				
			Ruby Testing / Libvips tests (3.3) (push) Blocked by required conditions
				
			Ruby Testing / End to End testing (.ruby-version) (push) Blocked by required conditions
				
			Ruby Testing / End to End testing (3.2) (push) Blocked by required conditions
				
			Ruby Testing / End to End testing (3.3) (push) Blocked by required conditions
				
			Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
				
			Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:8.10.2) (push) Blocked by required conditions
				
			Ruby Testing / Elastic Search integration testing (.ruby-version, opensearchproject/opensearch:2) (push) Blocked by required conditions
				
			Ruby Testing / Elastic Search integration testing (3.2, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
				
			Ruby Testing / Elastic Search integration testing (3.3, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
				
			
		
			
				
	
	
		
			56 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # frozen_string_literal: true
 | |
| 
 | |
| require 'rails_helper'
 | |
| 
 | |
| RSpec.describe 'Profile' do
 | |
|   include ProfileStories
 | |
| 
 | |
|   let(:local_domain) { Rails.configuration.x.local_domain }
 | |
| 
 | |
|   before do
 | |
|     as_a_logged_in_user
 | |
|     Fabricate(:user, account: Fabricate(:account, username: 'alice'))
 | |
|   end
 | |
| 
 | |
|   it 'I can view public account page for Alice' do
 | |
|     visit account_path('alice')
 | |
| 
 | |
|     expect(page)
 | |
|       .to have_title("alice (@alice@#{local_domain})")
 | |
|   end
 | |
| 
 | |
|   it 'I can change my account' do
 | |
|     visit settings_profile_path
 | |
| 
 | |
|     fill_in 'Display name', with: 'Bob'
 | |
|     fill_in 'Bio', with: 'Bob is silent'
 | |
| 
 | |
|     fill_in 'account_fields_attributes_0_name', with: 'Personal Website'
 | |
|     fill_in 'account_fields_attributes_0_value', with: 'https://host.example/personal'
 | |
| 
 | |
|     fill_in 'account_fields_attributes_1_name', with: 'Professional Biography'
 | |
|     fill_in 'account_fields_attributes_1_value', with: 'https://host.example/pro'
 | |
| 
 | |
|     expect { submit_form }
 | |
|       .to change { bob.account.reload.display_name }.to('Bob')
 | |
|       .and(change_account_fields)
 | |
|     expect(page)
 | |
|       .to have_content 'Changes successfully saved!'
 | |
|   end
 | |
| 
 | |
|   def submit_form
 | |
|     first('button[type=submit]').click
 | |
|   end
 | |
| 
 | |
|   def change_account_fields
 | |
|     change { bob.account.reload.fields }
 | |
|       .from([])
 | |
|       .to(
 | |
|         contain_exactly(
 | |
|           be_a(Account::Field),
 | |
|           be_a(Account::Field)
 | |
|         )
 | |
|       )
 | |
|   end
 | |
| end
 |