Sha256: bb3efef004fac8ee98a3ec6ac3faf6fd904c413fa20953470601585770dc0a11
Contents?: true
Size: 966 Bytes
Versions: 144
Compression:
Stored size: 966 Bytes
Contents
require "test_helper" class ArtefactExternalLinkTest < ActiveSupport::TestCase context "validating a link" do should "not be valid without a title or URL" do refute ArtefactExternalLink.new.valid? end should "not be valid with URL missing" do refute ArtefactExternalLink.new(:title => "Foo").valid? end should "not be valid with title missing" do refute ArtefactExternalLink.new(:url => "http://bar.com").valid? end should "be valid with both fields supplied" do link = ArtefactExternalLink.new(:title => "Foo", :url => "http://bar.com") assert link.valid? end should "only be valid if the URL is valid" do link = ArtefactExternalLink.new(:title => "Foo", :url => "notreal://foo.com") refute link.valid? end should "be valid with an https URL" do link = ArtefactExternalLink.new(:title => "Foo", :url => "https://bar.com") assert link.valid? end end end
Version data entries
144 entries across 144 versions & 1 rubygems