File tree Expand file tree Collapse file tree 4 files changed +26
-20
lines changed Expand file tree Collapse file tree 4 files changed +26
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ require 'test_helper'
2+
3+ describe Namespace ::Type do
4+ describe "class injection" do
5+ it "should build hierarchy classname correctly" do
6+ assert_equal "Namespace::TypeHierarchy" , Namespace ::Type . hierarchy_class . to_s
7+ assert_equal "Namespace::TypeHierarchy" , Namespace ::Type . _ct . hierarchy_class_name
8+ assert_equal "TypeHierarchy" , Namespace ::Type . _ct . short_hierarchy_class_name
9+ end
10+ end
11+ end
Original file line number Diff line number Diff line change 1- require 'spec_helper '
1+ require 'test_helper '
22
3- RSpec . describe ' Configuration' do
3+ describe " Configuration" do
44 it 'returns connection to the pool after has_closure_tree setup' do
55 class TypeDuplicate < ActiveRecord ::Base
66 self . table_name = "namespace_type#{ table_name_suffix } "
77 has_closure_tree
88 end
9- expect ( ActiveRecord ::Base . connection_pool . active_connection? ) . to be_falsey # +false+ in AR 4, +nil+ in AR 5
9+
10+ refute ActiveRecord ::Base . connection_pool . active_connection?
11+ # +false+ in AR 4, +nil+ in AR 5
1012 end
1113
1214 it 'returns connection to the pool after has_closure_tree setup with order' do
1315 class MetalDuplicate < ActiveRecord ::Base
1416 self . table_name = "#{ table_name_prefix } metal#{ table_name_suffix } "
1517 has_closure_tree order : 'sort_order' , name_column : 'value'
1618 end
17- expect ( ActiveRecord ::Base . connection_pool . active_connection? ) . to be_falsey
19+
20+ refute ActiveRecord ::Base . connection_pool . active_connection?
1821 end
1922
2023 it 'returns connection to the pool after has_closure_tree_root setup' do
2124 class GroupDuplicate < ActiveRecord ::Base
2225 self . table_name = "#{ table_name_prefix } group#{ table_name_suffix } "
2326 has_closure_tree_root :root_user
2427 end
25- expect ( ActiveRecord ::Base . connection_pool . active_connection? ) . to be_falsey
28+
29+ refute ActiveRecord ::Base . connection_pool . active_connection?
2630 end
2731end
Original file line number Diff line number Diff line change 1- require 'spec_helper '
1+ require 'test_helper '
22
3- RSpec . describe ClosureTree ::Support do
3+ describe ClosureTree ::Support do
44 let ( :sut ) { Tag . _ct }
5+
56 it 'passes through table names without prefix and suffix' do
67 expected = 'some_random_table_name'
7- expect ( sut . remove_prefix_and_suffix ( expected ) ) . to eq ( expected )
8+ assert_equal expected , sut . remove_prefix_and_suffix ( expected )
89 end
10+
911 it 'extracts through table name with prefix and suffix' do
1012 expected = 'some_random_table_name'
1113 tn = ActiveRecord ::Base . table_name_prefix + expected + ActiveRecord ::Base . table_name_suffix
12- expect ( sut . remove_prefix_and_suffix ( tn ) ) . to eq ( expected )
14+ assert_equal expected , sut . remove_prefix_and_suffix ( tn )
1315 end
1416end
You can’t perform that action at this time.
0 commit comments