Sha256: 20fb7b127af96d00c2afd49823bdc6f8f84c122048d83590da4be4d763bfaada

Contents?: true

Size: 902 Bytes

Versions: 6

Compression:

Stored size: 902 Bytes

Contents

require 'test_helper'

class ExtensionTest < ActiveSupport::TestCase
    
  def setup
    SpreeEssentials.essentials.clear
  end  
  
  should "have a hash as it's tab" do
    tab = { :label => "Examples", :route => "admin_examples" }
    assert_equal tab, SpreeEssentialExample.tab
  end
  
  should "have an array as it's subtab" do
    sub_tab = [ :examples, { :match_path => '/examples' }]
    assert_equal sub_tab, SpreeEssentialExample.sub_tab
  end
  
  should "start with zero essentials" do
    assert_equal 0, SpreeEssentials.essentials.length  
  end
  
  should "register an essential" do
    SpreeEssentials.register :example, SpreeEssentialExample
    assert_equal 1, SpreeEssentials.essentials.length
  end
      
  should "check if spree essentials has an extension" do
    SpreeEssentials.register :example, SpreeEssentialExample
    assert SpreeEssentials.has?(:example)
  end
  
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
spree_essentials_jn-0.6.1 test/unit/spree/extension_test.rb
spree_essentials_jn-0.6.0 test/unit/spree/extension_test.rb
spree_essentials-0.5.0 test/unit/spree/extension_test.rb
spree_essentials-0.5.0.rc1 test/unit/spree/extension_test.rb
spree_essentials-0.4.0 test/unit/spree/extension_test.rb
spree_essentials-0.4.0.rc3 test/unit/spree/extension_test.rb