Some minor change and spec for Account (#3813)
* Introduce domains method to Account relation Account had followers_domains method, which was excessively specific. Let relation of Account have domains method instead. * Move follow_mapping in Account to AccountInteractions * Introduce shared examples for AccountAvatar inclusion * Cover Account more
This commit is contained in:
		
					parent
					
						
							
								98fab24bea
							
						
					
				
			
			
				commit
				
					
						e27f792c24
					
				
			
		
					 5 changed files with 380 additions and 76 deletions
				
			
		
							
								
								
									
										19
									
								
								spec/support/examples/models/concerns/account_avatar.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								spec/support/examples/models/concerns/account_avatar.rb
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| # frozen_string_literal: true | ||||
| 
 | ||||
| shared_examples 'AccountAvatar' do |fabricator| | ||||
|   describe 'static avatars' do | ||||
|     describe 'when GIF' do | ||||
|       it 'creates a png static style' do | ||||
|         account = Fabricate(fabricator, avatar: attachment_fixture('avatar.gif')) | ||||
|         expect(account.avatar_static_url).to_not eq account.avatar_original_url | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|     describe 'when non-GIF' do | ||||
|       it 'does not create extra static style' do | ||||
|         account = Fabricate(fabricator, avatar: attachment_fixture('attachment.jpg')) | ||||
|         expect(account.avatar_static_url).to eq account.avatar_original_url | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| end | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue