wblog/spec/models/like_spec.rb

11 lines
215 B
Ruby
Raw Permalink Normal View History

require 'rails_helper'
2014-03-30 23:10:26 +08:00
RSpec.describe Like, type: :model do
2014-03-30 23:10:26 +08:00
it "add like" do
2016-04-25 12:27:32 +08:00
a = Post.create!(title: 'one', content: '1'*31)
2014-03-30 23:10:26 +08:00
like = Like.new
like.post = a
expect(like.save).to eq(true)
end
end