Sha256: 16c57df98c2455209529206b7146d4f0e19457d16ef1f545618fd4c26d6e76c7

Contents?: true

Size: 985 Bytes

Versions: 4

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

4 entries across 4 versions & 1 rubygems

Version Path
guts-1.0.8 test/models/guts/group_test.rb
guts-1.0.7 test/models/guts/group_test.rb
guts-1.0.5 test/models/guts/group_test.rb
guts-1.0.3 test/models/guts/group_test.rb