Files
bit/test/models/link_test.rb
T
Juan Rodriguez 587f9552c8 feat: Link model
create_links and slug index migrations. generate_slug and shorten model methods

- Create links migration - Add slug index migration
2021-06-13 10:55:05 -05:00

17 lines
407 B
Ruby

# frozen_string_literal: true
require 'test_helper'
class LinkTest < ActiveSupport::TestCase
test 'should not save a link without a url' do
link = Link.new
assert_not link.save, 'Saved the link without a url'
end
test 'should not save a link with a invalid url' do
link = Link.new
link.url = 'google.com'
assert_not link.save, 'Saved the link with invalid url format'
end
end