Commit 906b44e5 by tady

fix post factory

parent bd262a8c
......@@ -17,6 +17,7 @@
FactoryGirl.define do
factory :post do
association :author, factory: :alice
title 'sample title'
body 'sample body'
specified_date Date.new(2014, 4, 1)
......
......@@ -16,7 +16,8 @@ require 'rails_helper'
describe Notification do
describe 'Instance method' do
let(:alice) { create(:alice) }
let(:bob) { create(:bob) }
let(:post) { create(:post) }
it "notifies on post edited" do
end
......
......@@ -20,17 +20,13 @@ describe Post do
describe 'Instance method' do
before :each do
@post = create(:post)
@alice = create(:alice)
@new_post = @post.generate_fork(@alice)
@bob = create(:bob)
@new_post = @post.generate_fork(@bob)
@new_post.save
end
describe 'Fork' do
# subject {
# @post.generate_fork(@alice).save
# }
it 'duplicated' do
expect(@new_post.id).not_to eq(@post.id)
end
......@@ -44,7 +40,7 @@ describe Post do
end
it 'valid user' do
expect(@new_post.author).to eq(@alice)
expect(@new_post.author).to eq(@bob)
end
it 'valid user' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment