Some specs for file Attachment
This commit is contained in:
		
							parent
							
								
									2581895c7c
								
							
						
					
					
						commit
						7265d31f62
					
				@ -1,6 +1,7 @@
 | 
				
			|||||||
require 'spec_helper'
 | 
					require 'spec_helper'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
describe Refinery::WordPress::Attachment, :type => :model do
 | 
					describe Refinery::WordPress::Attachment, :type => :model do
 | 
				
			||||||
 | 
					  context "an image attchment" do
 | 
				
			||||||
    let(:attachment) { test_dump.attachments.first }
 | 
					    let(:attachment) { test_dump.attachments.first }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    specify { attachment.title.should == '200px-Tux.svg' }
 | 
					    specify { attachment.title.should == '200px-Tux.svg' }
 | 
				
			||||||
@ -41,4 +42,15 @@ describe Refinery::WordPress::Attachment, :type => :model do
 | 
				
			|||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  context "a file attachment" do
 | 
				
			||||||
 | 
					    let(:attachment) { test_dump.attachments.last }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    specify { attachment.title.should == 'cv' }
 | 
				
			||||||
 | 
					    specify { attachment.url.should == 'http://localhost/wordpress/wp-content/uploads/2011/05/cv.txt' }
 | 
				
			||||||
 | 
					    specify { attachment.file_name.should == 'cv.txt' }
 | 
				
			||||||
 | 
					    specify { attachment.post_date.should == DateTime.new(2011, 6, 6, 17, 27, 50) }
 | 
				
			||||||
 | 
					    specify { attachment.should_not be_an_image }
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user