responsive_image_tag 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -1,7 +1,8 @@
1
1
  module ResponsiveImageTag
2
2
 
3
3
  def responsive_image_tag(small, big, options = {})
4
- options = options.merge!("full-src" => big)
4
+ full_src = ENV["RAILS_ASSET_ID"] + big
5
+ options = options.merge!("full-src" => full_src)
5
6
  image_tag(small, options)
6
7
  end
7
8
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{responsive_image_tag}
8
- s.version = "0.0.0"
8
+ s.version = "0.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dave Hrycyszyn"]
@@ -39,8 +39,20 @@ class TestResponsiveImageTag < MiniTest::Unit::TestCase
39
39
  it "should have an alt attribute with a value of 'foo'" do
40
40
  @tag.must_match "alt=\"foo\""
41
41
  end
42
- end
42
+ end
43
+
44
+ describe "with ENV['RAILS_ASSET_ID'] set" do
45
+ before do
46
+ ENV["RAILS_ASSET_ID"] = "images/"
47
+ view = ActionView::Base.new
48
+ @tag = view.responsive_image_tag("small.jpg", "big.jpg")
49
+ end
50
+
51
+ it "should prepend the correct asset path onto full-src" do
52
+ @tag.must_match "full-src=\"images/big.jpg\""
53
+ end
54
+ end
55
+
43
56
  end
44
-
45
57
  end
46
58
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: responsive_image_tag
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 1
10
+ version: 0.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dave Hrycyszyn