Add tests for Status#verb (#5717)
This commit is contained in:
		
							parent
							
								
									3023725936
								
							
						
					
					
						commit
						556c07df1f
					
				
					 1 changed files with 21 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -47,8 +47,27 @@ RSpec.describe Status, type: :model do
 | 
			
		|||
  end
 | 
			
		||||
 | 
			
		||||
  describe '#verb' do
 | 
			
		||||
    it 'is always post' do
 | 
			
		||||
      expect(subject.verb).to be :post
 | 
			
		||||
    context 'if destroyed?' do
 | 
			
		||||
      it 'returns :delete' do
 | 
			
		||||
        subject.destroy!
 | 
			
		||||
        expect(subject.verb).to be :delete
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    context 'unless destroyed?' do
 | 
			
		||||
      context 'if reblog?' do
 | 
			
		||||
        it 'returns :share' do
 | 
			
		||||
          subject.reblog = other
 | 
			
		||||
          expect(subject.verb).to be :share
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      context 'unless reblog?' do
 | 
			
		||||
        it 'returns :post' do
 | 
			
		||||
          subject.reblog = nil
 | 
			
		||||
          expect(subject.verb).to be :post
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue