ensl.org/spec/models/post_spec.rb

31 lines
571 B
Ruby
Raw Normal View History

2015-08-20 14:57:29 +00:00
# == Schema Information
#
# Table name: posts
#
# id :integer not null, primary key
# text :text
# topic_id :integer
# user_id :integer
# created_at :datetime
# updated_at :datetime
# text_parsed :text
#
2019-10-17 18:29:15 +00:00
require "rails_helper"
2015-08-20 14:57:29 +00:00
describe Post do
let!(:user) { create :user }
describe "create" do
let(:post) { build :post }
it "creates a new post" do
# expect(post.valid?).to eq(true)
post.topic = create :topic
expect do
post.save!
end.to change(Post, :count).by(1)
end
end
end