Permalink
Browse files

include spec to check for valid file formats when including a screenshot

  • Loading branch information...
1 parent 84776e7 commit 42f0d8c275289cd6b27998517d3a5b7e7fa3c613 @jurre jurre committed May 10, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 spec/packages_spec.rb
@@ -41,4 +41,13 @@
list.map {|p| p["name"].downcase}.uniq.size.should == list.size
end
end
+
+ it "should have valid URLs for screenshots if they are present" do
+ valid_image_formats = %w(png jpg jpeg bmp gif)
+ @packages.values.flatten.each do |package|
+ if package.has_key? 'screenshot'
+ valid_image_formats.should include package['screenshot'].split('.').last
+ end
+ end
+ end
end

0 comments on commit 42f0d8c

Please sign in to comment.