public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
mephisto / test / unit / asset_drop_test.rb
100644 54 lines (40 sloc) 1.528 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require File.dirname(__FILE__) + '/../test_helper'
 
context "Asset Drop" do
  fixtures :sites, :assets
  
  specify "should report as images" do
    [:gif, :png].each { |f| assert assets(f).to_liquid.is_image }
  end
  
  specify "should not report as images" do
    [:mp3, :mov, :pdf, :swf, :word].each { |f| assert !assets(f).to_liquid.is_image }
  end
  
  specify "should report as movies" do
    [:swf, :mov].each { |f| assert assets(f).to_liquid.is_movie }
  end
  
  specify "should not report as movies" do
    [:mp3, :gif, :pdf, :png, :word].each { |f| assert !assets(f).to_liquid.is_movie }
  end
  
  specify "should report as audio" do
    [:mp3].each { |f| assert assets(f).to_liquid.is_audio }
  end
  
  specify "should not report as audio" do
    [:gif, :pdf, :png, :word, :swf, :mov].each { |f| assert !assets(f).to_liquid.is_audio }
  end
  
  specify "should report as other" do
    [:word, :pdf].each { |f| assert assets(f).to_liquid.is_other }
  end
  
  specify "should not report as other" do
    [:mp3, :gif, :png, :swf, :mov].each { |f| assert !assets(f).to_liquid.is_other }
  end
  
  specify "should report as pdf" do
    [:pdf].each { |f| assert assets(f).to_liquid.is_pdf }
  end
  
  specify "should not report as pdf" do
    [:mp3, :gif, :png, :word, :swf, :mov].each { |f| assert !assets(f).to_liquid.is_pdf }
  end
end
 
context "Asset Drop Tags" do
  fixtures :sites, :assets, :tags, :taggings
  
  specify "should list tags" do
    assert_equal %w(ruby), assets(:gif).to_liquid.tags
  end
end