Sha256: 736f56ed7e8df492b207b5d590f26e060dd26ac32057003ae8fc82b4592685e5

Contents?: true

Size: 1.26 KB

Versions: 72

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper'

describe ActiveAdmin::Sass::Helpers do

  include ActiveAdmin::Sass::Helpers

  context "when not using the asset pipeline" do

    before(:all)do
      @actual_rails_version = Rails::VERSION::MINOR
      silence_warnings { Rails::VERSION::MINOR = 0 }
    end

    after(:all) do
      silence_warnings { Rails::VERSION::MINOR = @actual_rails_version }
    end

    it "should generate an image asset path to /images/active_admin" do
      active_admin_image_path(Sass::Script::String.new('test.jpg')).should ==
          Sass::Script::String.new("/images/active_admin/test.jpg", true)
    end

  end

  context "when using the asset pipeline" do
    before(:all)do
      @actual_rails_version = Rails::VERSION::MINOR
      silence_warnings { Rails::VERSION::MINOR = 1 }
    end

    after(:all) do
      silence_warnings { Rails::VERSION::MINOR = @actual_rails_version }
    end

    before do
      assets = mock(:enabled => true)
      Rails.application.config.stub!(:assets => assets)
    end

    it "should call the sass-rails asset helper" do
      self.should_receive(:asset_path).with(Sass::Script::String.new("active_admin/test.jpg"), Sass::Script::String.new('image'))
      active_admin_image_path(::Sass::Script::String.new('test.jpg'))
    end

  end

end

Version data entries

72 entries across 72 versions & 4 rubygems

Version Path
activeadmin-0.6.6 spec/unit/sass/helpers_spec.rb
activeadmin-0.6.5 spec/unit/sass/helpers_spec.rb
activeadmin-0.6.4 spec/unit/sass/helpers_spec.rb
activeadmin-0.6.3 spec/unit/sass/helpers_spec.rb
activeadmin-0.6.2 spec/unit/sass/helpers_spec.rb
activeadmin-0.6.1 spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.141 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/spec/unit/sass/helpers_spec.rb