Class: Config::CreateTest
- Defined in:
- lib/six-updater-web/vendor/plugins/active_scaffold/test/config/create_test.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #teardown ⇒ Object
- #test_default_options ⇒ Object
- #test_edit_after_create ⇒ Object
- #test_label ⇒ Object
- #test_link_defaults ⇒ Object
- #test_persistent ⇒ Object
- #test_setting_link ⇒ Object
Instance Method Details
#setup ⇒ Object
4 5 6 7 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/create_test.rb', line 4 def setup @config = ActiveScaffold::Config::Core.new :model_stub @default_link = @config.create.link end |
#teardown ⇒ Object
9 10 11 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/create_test.rb', line 9 def teardown @config.create.link = @default_link end |
#test_default_options ⇒ Object
13 14 15 16 17 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/create_test.rb', line 13 def assert !@config.create.persistent assert !@config.create.edit_after_create assert_equal 'Create Model Stub', @config.create.label end |
#test_edit_after_create ⇒ Object
51 52 53 54 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/create_test.rb', line 51 def test_edit_after_create @config.create.edit_after_create = true assert @config.create.edit_after_create end |
#test_label ⇒ Object
40 41 42 43 44 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/create_test.rb', line 40 def test_label label = 'create new monkeys' @config.create.label = label assert_equal label, @config.create.label end |
#test_link_defaults ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/create_test.rb', line 19 def test_link_defaults link = @config.create.link assert !link.page? assert !link.popup? assert !link.confirm? assert_equal "new", link.action assert_equal "Create New", link.label assert link.inline? blank = {} assert_equal blank, link. assert_equal :get, link.method assert_equal :table, link.type assert_equal :create, link.crud_type assert_equal :create_authorized?, link.security_method end |
#test_persistent ⇒ Object
46 47 48 49 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/create_test.rb', line 46 def test_persistent @config.create.persistent = true assert @config.create.persistent end |
#test_setting_link ⇒ Object
35 36 37 38 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/test/config/create_test.rb', line 35 def test_setting_link @config.create.link = ActiveScaffold::DataStructures::ActionLink.new('update', :label => 'Monkeys') assert_not_equal(@default_link, @config.create.link) end |