tests coming along
This commit is contained in:
parent
b652d54b8a
commit
2560fc36e7
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,6 +4,9 @@
|
||||
# or operating system, you probably want to add a global ignore instead:
|
||||
# git config --global core.excludesfile '~/.gitignore_global'
|
||||
|
||||
**/.keep
|
||||
**/.core
|
||||
|
||||
# Ignore bundler config.
|
||||
/.bundle
|
||||
|
||||
|
||||
@ -1,2 +1,4 @@
|
||||
class Virtual < ApplicationRecord
|
||||
validates :email, presence: true
|
||||
validates :destination, presence: true
|
||||
end
|
||||
|
||||
9
db/schema.rb
generated
9
db/schema.rb
generated
@ -10,7 +10,14 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_05_10_141218) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_05_10_184959) do
|
||||
create_table "credentials", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
t.string "email"
|
||||
t.string "password"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "domains", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
t.string "domain"
|
||||
t.datetime "created_at", null: false
|
||||
|
||||
BIN
test/fixtures/.credentials.yml.kate-swp
vendored
Normal file
BIN
test/fixtures/.credentials.yml.kate-swp
vendored
Normal file
Binary file not shown.
Binary file not shown.
@ -1,7 +1,34 @@
|
||||
require "test_helper"
|
||||
|
||||
class VirtualTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
test "the email cant be blank" do
|
||||
@v = Virtual.new
|
||||
@v.destination = "davesmith@example.com"
|
||||
assert !@v.save
|
||||
end
|
||||
|
||||
test "the destination email cant be blank" do
|
||||
@v = Virtual.new
|
||||
@v.email = "davesmith@example.com"
|
||||
assert !@v.save
|
||||
end
|
||||
|
||||
test "the domain name of the email must be on this server" do
|
||||
@v = Virtual.new
|
||||
@v.email = "davesmith@notonthisserver.com"
|
||||
@v.destination = "bob@example.net"
|
||||
assert !@v.save
|
||||
end
|
||||
|
||||
test "the email must be a valid email" do
|
||||
# flunk()
|
||||
end
|
||||
|
||||
test "the destination must be a valid email" do
|
||||
# flunk()
|
||||
end
|
||||
|
||||
test "the email plus destination must be unique" do
|
||||
# flunk()
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user