2023-10-05 15:46:07 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-09-17 11:45:24 +00:00
|
|
|
require "test_helper"
|
|
|
|
|
|
|
|
class MicropostTest < ActiveSupport::TestCase
|
2023-10-05 15:46:07 +00:00
|
|
|
setup do
|
|
|
|
@micropost = microposts(:one)
|
|
|
|
assert @micropost.valid?
|
|
|
|
end
|
|
|
|
|
|
|
|
test "must have a user" do
|
|
|
|
@micropost.user = nil
|
|
|
|
assert_not @micropost.valid?
|
|
|
|
end
|
|
|
|
|
|
|
|
test "must have content" do
|
|
|
|
@micropost.content = nil
|
|
|
|
assert_not @micropost.valid?
|
|
|
|
end
|
2023-09-17 11:45:24 +00:00
|
|
|
end
|