Adding initialize_with to FactoryGirl config in previous commit allowed
to call FactoryGirl.build for entities, so use it wherever possible.
This commit is contained in:
parent
e8fa25c6a6
commit
c9e641f3c5
3 changed files with 6 additions and 7 deletions
|
|
@ -54,8 +54,7 @@ FactoryGirl.define do
|
||||||
url "http://localhost:3000/"
|
url "http://localhost:3000/"
|
||||||
exported_key { generate(:public_key) }
|
exported_key { generate(:public_key) }
|
||||||
profile {
|
profile {
|
||||||
DiasporaFederation::Entities::Profile.new(
|
FactoryGirl.build(:profile_entity, diaspora_id: diaspora_id)
|
||||||
FactoryGirl.attributes_for(:profile_entity, diaspora_id: diaspora_id))
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ module DiasporaFederation
|
||||||
@datetime = DateTime.now.utc
|
@datetime = DateTime.now.utc
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:msg1) { Entities::Message.new(FactoryGirl.attributes_for(:message_entity)) }
|
let(:msg1) { FactoryGirl.build(:message_entity) }
|
||||||
let(:msg2) { Entities::Message.new(FactoryGirl.attributes_for(:message_entity)) }
|
let(:msg2) { FactoryGirl.build(:message_entity) }
|
||||||
let(:data) {
|
let(:data) {
|
||||||
{guid: FactoryGirl.generate(:guid),
|
{guid: FactoryGirl.generate(:guid),
|
||||||
subject: "very interesting conversation subject",
|
subject: "very interesting conversation subject",
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
describe Entities::StatusMessage do
|
describe Entities::StatusMessage do
|
||||||
let(:photo1) { Entities::Photo.new(FactoryGirl.attributes_for(:photo_entity)) }
|
let(:photo1) { FactoryGirl.build(:photo_entity) }
|
||||||
let(:photo2) { Entities::Photo.new(FactoryGirl.attributes_for(:photo_entity)) }
|
let(:photo2) { FactoryGirl.build(:photo_entity) }
|
||||||
let(:location) { Entities::Location.new(FactoryGirl.attributes_for(:location_entity)) }
|
let(:location) { FactoryGirl.build(:location_entity) }
|
||||||
let(:data) {
|
let(:data) {
|
||||||
{
|
{
|
||||||
raw_message: "this is such an interesting text",
|
raw_message: "this is such an interesting text",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue