Class: Config::ListTest
- Defined in:
- lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_always_show_create ⇒ Object
- #test_always_show_create_when_create_is_not_enabled ⇒ Object
- #test_always_show_search ⇒ Object
- #test_always_show_search_when_field_search ⇒ Object
- #test_always_show_search_when_search_is_not_enabled ⇒ Object
- #test_default_options ⇒ Object
- #test_filtered_message ⇒ Object
- #test_no_entries ⇒ Object
- #test_per_page ⇒ Object
Instance Method Details
#setup ⇒ Object
4 5 6 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 4 def setup @config = ActiveScaffold::Config::Core.new :model_stub end |
#test_always_show_create ⇒ Object
35 36 37 38 39 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 35 def test_always_show_create always_show_create = true @config.list.always_show_create = always_show_create assert_equal always_show_create, @config.list.always_show_create end |
#test_always_show_create_when_create_is_not_enabled ⇒ Object
41 42 43 44 45 46 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 41 def test_always_show_create_when_create_is_not_enabled always_show_create = true @config.list.always_show_create = always_show_create @config.actions.exclude :create assert_equal false, @config.list.always_show_create end |
#test_always_show_search ⇒ Object
48 49 50 51 52 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 48 def test_always_show_search @config.list.always_show_search = true assert @config.list.always_show_search assert_equal 'search', @config.list.search_partial end |
#test_always_show_search_when_field_search ⇒ Object
60 61 62 63 64 65 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 60 def test_always_show_search_when_field_search @config.list.always_show_search = true @config.actions.swap :search, :live_search assert @config.list.always_show_search assert_equal 'live_search', @config.list.search_partial end |
#test_always_show_search_when_search_is_not_enabled ⇒ Object
54 55 56 57 58 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 54 def test_always_show_search_when_search_is_not_enabled @config.list.always_show_search = true @config.actions.exclude :search assert_equal false, @config.list.always_show_search end |
#test_default_options ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 8 def assert_equal 15, @config.list.per_page assert_equal '-', @config.list.empty_field_text assert @config.actions.include?(:search) assert_equal 'search', @config.list.search_partial assert_equal 'No Entries', @config.list. assert_equal 'Filtered List', @config.list. assert !@config.list.always_show_create assert !@config.list.always_show_search end |
#test_filtered_message ⇒ Object
24 25 26 27 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 24 def @config.list. = 'filtered items' assert_equal 'filtered items', @config.list. end |
#test_no_entries ⇒ Object
19 20 21 22 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 19 def test_no_entries @config.list. = 'No items' assert_equal 'No items', @config.list. end |
#test_per_page ⇒ Object
29 30 31 32 33 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/list_test.rb', line 29 def test_per_page per_page = 35 @config.list.per_page = per_page assert_equal per_page, @config.list.per_page end |