Skip to content

Commit

Permalink
model post
Browse files Browse the repository at this point in the history
  • Loading branch information
anhtaka committed Sep 19, 2018
1 parent bca56da commit 1252149
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/post.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Post < ApplicationRecord
end
9 changes: 9 additions & 0 deletions db/migrate/20180919153610_create_posts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CreatePosts < ActiveRecord::Migration[5.2]
def change
create_table :posts do |t|
t.text :content

t.timestamps
end
end
end
7 changes: 7 additions & 0 deletions test/fixtures/posts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
content: MyText

two:
content: MyText
7 changes: 7 additions & 0 deletions test/models/post_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class PostTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit 1252149

Please sign in to comment.