parent
1503376fa6
commit
62b375bb8e
1 changed files with 16 additions and 17 deletions
|
|
@ -111,23 +111,20 @@ describe Comment, :type => :model do
|
||||||
|
|
||||||
#Andy fragen - shared behaviour
|
#Andy fragen - shared behaviour
|
||||||
describe 'it is relayable' do
|
describe 'it is relayable' do
|
||||||
let(:remote_parent) { build(:status_message, author: @remote_raphael) }
|
let(:remote_parent) { build(:status_message, author: remote_raphael) }
|
||||||
let(:local_parent) { @local_luke.post :status_message, text: "hi", to: @local_luke.aspects.first }
|
let(:local_parent) { local_luke.post :status_message, text: "hi", to: local_luke.aspects.first }
|
||||||
let(:object_by_parent_author) { @local_luke.comment!(text: "yo!", post: local_parent) }
|
let(:object_by_parent_author) { local_luke.comment!(local_parent, "yo!") }
|
||||||
let(:object_by_recipient) { @local_leia.build_comment(text: "yo", post: local_parent) }
|
let(:object_by_recipient) { local_leia.build_comment(text: "yo", post: local_parent) }
|
||||||
let(:dup_object_by_parent_author) { object_by_parent_author.dup }
|
let(:dup_object_by_parent_author) { object_by_parent_author.dup }
|
||||||
let(:object_on_remote_parent) { @local_luke.comment!(remote_parent, "Yeah, it was great") }
|
let(:object_on_remote_parent) { local_luke.comment!(remote_parent, "Yeah, it was great") }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
local_luke, @local_leia, @remote_raphael = set_up_friends
|
# shared_behaviors/relayable.rb is still using instance variables, so we need to define them here.
|
||||||
# @remote_parent = FactoryGirl.build(:status_message, :author => @remote_raphael)
|
# Suggestion: refactor all specs using shared_behaviors/relayable.rb to use 'let'
|
||||||
# @local_parent = @local_luke.post :status_message, :text => "hi", :to => @local_luke.aspects.first
|
@object_by_parent_author = object_by_parent_author
|
||||||
|
@object_by_recipient = object_by_recipient
|
||||||
# @object_by_parent_author = @local_luke.comment!(@local_parent, "yo")
|
@dup_object_by_parent_author = dup_object_by_parent_author
|
||||||
# @object_by_recipient = @local_leia.build_comment(:text => "yo", :post => @local_parent)
|
@object_on_remote_parent = object_on_remote_parent
|
||||||
# @dup_object_by_parent_author = @object_by_parent_author.dup
|
|
||||||
|
|
||||||
# @object_on_remote_parent = @local_luke.comment!(@remote_parent, "Yeah, it was great")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:build_object) { alice.build_comment(:post => status_bob, :text => "why so formal?") }
|
let(:build_object) { alice.build_comment(:post => status_bob, :text => "why so formal?") }
|
||||||
|
|
@ -137,9 +134,11 @@ describe Comment, :type => :model do
|
||||||
describe 'tags' do
|
describe 'tags' do
|
||||||
let(:object) { build(:comment) }
|
let(:object) { build(:comment) }
|
||||||
|
|
||||||
# before do
|
before do
|
||||||
# @object = FactoryGirl.build(:comment)
|
# shared_behaviors/taggable.rb is still using instance variables, so we need to define them here.
|
||||||
# end
|
# Suggestion: refactor all specs using shared_behaviors/taggable.rb to use 'let'
|
||||||
|
@object = object
|
||||||
|
end
|
||||||
it_should_behave_like 'it is taggable'
|
it_should_behave_like 'it is taggable'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue