Sha256: 746f03c20e6d4f79c06d2ebd325e7ca70bcecccd91f6820da7ac86b8a34b8fff

Contents?: true

Size: 1.15 KB

Versions: 13

Compression:

Stored size: 1.15 KB

Contents

require 'test_helper'

module Guts
  class NavigationTest < ActiveSupport::TestCase
    test 'should not create without title' do
      navigation = Navigation.new
      
      assert_not navigation.save
    end
    
    test 'should create slug for title' do
      navigation       = Navigation.new
      navigation.title = 'Footer Menu' 
      navigation.save
      
      assert_equal 'footer-menu', navigation.slug
    end
    
    test 'should return metafields for navigation' do
      navigation = guts_navigations :test_navigation
      
      assert_operator navigation.metafields.size, :>, 0
    end
    
    test 'should return items for navigation' do
      navigation = guts_navigations :test_navigation
      
      assert_operator navigation.navigation_items.size, :>, 0
    end
    
    test 'should be trackable' do
      assert_equal true, Navigation.methods.include?(:trackable)
    end
    
    test 'navigation item should be multisite compatible' do
      assert NavigationItem.all.to_sql.include?('site_id')
    end
    
    test 'navigation should be multisite compatible' do
      assert Navigation.all.to_sql.include?('site_id')
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
guts-1.4.0 test/models/guts/navigation_test.rb
guts-1.3.6 test/models/guts/navigation_test.rb
guts-1.3.5 test/models/guts/navigation_test.rb
guts-1.3.4 test/models/guts/navigation_test.rb
guts-1.3.3 test/models/guts/navigation_test.rb
guts-1.3.2 test/models/guts/navigation_test.rb
guts-1.3.1 test/models/guts/navigation_test.rb
guts-1.3.0 test/models/guts/navigation_test.rb
guts-1.2.2 test/models/guts/navigation_test.rb
guts-1.2.1 test/models/guts/navigation_test.rb
guts-1.2.0 test/models/guts/navigation_test.rb
guts-1.1.1 test/models/guts/navigation_test.rb
guts-1.1.0 test/models/guts/navigation_test.rb