Sha256: 262ba7556caef58295c452e2d2b3c876de2554b32eb318d4eef8fb3b23b6b56a

Contents?: true

Size: 985 Bytes

Versions: 12

Compression:

Stored size: 985 Bytes

Contents

require 'test_helper'

module Guts
  class GroupTest < ActiveSupport::TestCase
    test 'should not create without title' do
      group = Group.new
      
      assert_not group.save
    end
    
    test 'should not create with title less than three characters' do
      group       = Group.new
      group.title = '12' 
      
      assert_not group.save
    end
    
    test 'should create slug for title' do
      group       = Group.new
      group.title = 'Customer Group' 
      group.save
      
      assert_equal 'customer-group', group.slug
    end
    
    test 'should return users for group' do
      group = guts_groups :test_group
      
      assert_operator group.users.size, :>, 0
    end
    
    test 'should return metafields for group' do
      group = guts_groups :test_group
      
      assert_operator group.metafields.size, :>, 0
    end
    
    test 'should be trackable' do
      assert_equal true, Group.methods.include?(:trackable)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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