Sha256: afa28d042562ab20cfb3d1698e593533bb32b21588fc917dafd35f25813cb214

Contents?: true

Size: 897 Bytes

Versions: 1

Compression:

Stored size: 897 Bytes

Contents

require 'test_helper'

class ConfigurationTest < ActionDispatch::IntegrationTest
  class FooPresenter
    THINGS = %w[thing1 thing2 thing3]
  end

  setup do
    MintReporter.config do |c|
      c.paperclip_storage_options = {
        :url => "http://example.com/uploads/:style.:extension",
        :path => ":rails_root/public/uploads/:style.:extension"
      }
      c.reports = {:foo_presenter => {:fields => FooPresenter::THINGS}}
    end
  end

  test "accepts paperclip config" do
    paperclip_config = {}
    paperclip_config[:url] = "http://example.com/uploads/:style.:extension"
    paperclip_config[:path] = ":rails_root/public/uploads/:style.:extension"
    assert_equal paperclip_config, MintReporter.config.paperclip_storage_options
  end

  test "accepts reports config" do
    assert_equal FooPresenter::THINGS,
      MintReporter.config.reports[:foo_presenter][:fields]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mint_reporter-0.0.7 test/integration/configuration_test.rb