Sha256: ef62dc765857474bdd66d4c8ee5ba9048358377d6604a646fa89ec450b361cfa

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
guts-2.1.0 test/models/guts/group_test.rb
guts-2.0.2 test/models/guts/group_test.rb
guts-2.0.1 test/models/guts/group_test.rb
guts-2.0.0 test/models/guts/group_test.rb