mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-24 08:41:56 +08:00
22 lines
405 B
Ruby
22 lines
405 B
Ruby
|
require 'test_helper'
|
||
|
|
||
|
class ProtocolKeywordTest < ActiveSupport::TestCase
|
||
|
|
||
|
def setup
|
||
|
@kw = protocol_keywords(:kw1)
|
||
|
end
|
||
|
|
||
|
test "should not validate without name" do
|
||
|
assert @kw.valid?
|
||
|
@kw.name = nil
|
||
|
assert_not @kw.valid?
|
||
|
end
|
||
|
|
||
|
test "should not validate with name too long" do
|
||
|
@kw.name = "A" * 50
|
||
|
assert @kw.valid?
|
||
|
@kw.name = "A" * 51
|
||
|
assert_not @kw.valid?
|
||
|
end
|
||
|
|
||
|
end
|