class RecordIdentifierWithoutActiveModelTest

Public Instance Methods

setup() click to toggle source
# File actionview/test/template/record_identifier_test.rb, line 55
def setup
  @record = Plane.new
end
test_dom_class() click to toggle source
# File actionview/test/template/record_identifier_test.rb, line 77
def test_dom_class
  assert_equal "airplane", dom_class(@record)
end
test_dom_class_as_singleton_method() click to toggle source
# File actionview/test/template/record_identifier_test.rb, line 90
def test_dom_class_as_singleton_method
  assert_equal "airplane", ActionView::RecordIdentifier.dom_class(@record)
end
test_dom_class_with_prefix() click to toggle source
# File actionview/test/template/record_identifier_test.rb, line 81
def test_dom_class_with_prefix
  assert_equal "custom_prefix_airplane", dom_class(@record, :custom_prefix)
end
test_dom_id_as_singleton_method() click to toggle source
# File actionview/test/template/record_identifier_test.rb, line 85
def test_dom_id_as_singleton_method
  @record.save
  assert_equal "airplane_1", ActionView::RecordIdentifier.dom_id(@record)
end
test_dom_id_with_new_record() click to toggle source
# File actionview/test/template/record_identifier_test.rb, line 59
def test_dom_id_with_new_record
  assert_equal "new_airplane", dom_id(@record)
end
test_dom_id_with_new_record_and_prefix() click to toggle source
# File actionview/test/template/record_identifier_test.rb, line 63
def test_dom_id_with_new_record_and_prefix
  assert_equal "custom_prefix_airplane", dom_id(@record, :custom_prefix)
end
test_dom_id_with_prefix() click to toggle source
# File actionview/test/template/record_identifier_test.rb, line 72
def test_dom_id_with_prefix
  @record.save
  assert_equal "edit_airplane_1", dom_id(@record, :edit)
end
test_dom_id_with_saved_record() click to toggle source
# File actionview/test/template/record_identifier_test.rb, line 67
def test_dom_id_with_saved_record
  @record.save
  assert_equal "airplane_1", dom_id(@record)
end