Sha256: 206aa128318b4d6da4b672d22f09932cd5d7dc60c05c920d814d3772773e581b

Contents?: true

Size: 852 Bytes

Versions: 10

Compression:

Stored size: 852 Bytes

Contents

# -*- encoding: utf-8 -*-

require "test_helper"

class Admin::SidebarHelperTest < ActiveSupport::TestCase

  include Admin::SidebarHelper

  include ActionView::Helpers::UrlHelper
  include ActionView::Helpers::TagHelper
  include ActionView::Helpers::FormTagHelper

  def render(*args); args; end
  def link_to(*args); args; end

  setup do
    default_url_options[:host] = 'test.host'
  end

  context "export" do

    should "return array with expected values" do
      params = { :controller => '/admin/posts', :action => 'index' }

      output = export(Post , params)
      expected = [["Export as CSV", { :action => "index", :format => "csv", :controller => "/admin/posts" }],
                  ["Export as XML", { :action => "index", :format => "xml", :controller => "/admin/posts" }]]

      assert_equal expected, output
    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
typus-3.0.11 test/app/helpers/admin/sidebar_helper_test.rb
typus-3.0.11.rc5 test/app/helpers/admin/sidebar_helper_test.rb
typus-3.0.11.rc4 test/app/helpers/admin/sidebar_helper_test.rb
typus-3.0.11.rc3 test/app/helpers/admin/sidebar_helper_test.rb
typus-3.0.11.rc2 test/app/helpers/admin/sidebar_helper_test.rb
typus-3.0.11.rc1 test/app/helpers/admin/sidebar_helper_test.rb
typus-3.0.10 test/app/helpers/admin/sidebar_helper_test.rb
typus-3.0.9 test/app/helpers/admin/sidebar_helper_test.rb
typus-3.0.8 test/app/helpers/admin/sidebar_helper_test.rb
typus-3.0.7 test/app/helpers/admin/sidebar_helper_test.rb