Partly replace hard-coded hashes in specs with FactoryGirl.attributes_for
This commit is contained in:
parent
c9e641f3c5
commit
148300b329
2 changed files with 6 additions and 17 deletions
|
|
@ -1,18 +1,12 @@
|
|||
module DiasporaFederation
|
||||
describe Entities::Conversation do
|
||||
before do
|
||||
@datetime = DateTime.now.utc
|
||||
end
|
||||
|
||||
let(:msg1) { FactoryGirl.build(:message_entity) }
|
||||
let(:msg2) { FactoryGirl.build(:message_entity) }
|
||||
let(:data) {
|
||||
{guid: FactoryGirl.generate(:guid),
|
||||
subject: "very interesting conversation subject",
|
||||
created_at: @datetime,
|
||||
messages: [msg1, msg2],
|
||||
diaspora_id: FactoryGirl.generate(:diaspora_id),
|
||||
participant_ids: "#{FactoryGirl.generate(:diaspora_id)};#{FactoryGirl.generate(:diaspora_id)}"}
|
||||
FactoryGirl.attributes_for(:conversation_entity).merge!(
|
||||
messages: [msg1, msg2],
|
||||
participant_ids: "#{FactoryGirl.generate(:diaspora_id)};#{FactoryGirl.generate(:diaspora_id)}"
|
||||
)
|
||||
}
|
||||
|
||||
let(:xml) {
|
||||
|
|
|
|||
|
|
@ -4,17 +4,12 @@ module DiasporaFederation
|
|||
let(:photo2) { FactoryGirl.build(:photo_entity) }
|
||||
let(:location) { FactoryGirl.build(:location_entity) }
|
||||
let(:data) {
|
||||
{
|
||||
raw_message: "this is such an interesting text",
|
||||
FactoryGirl.attributes_for(:status_message_entity).merge!(
|
||||
photos: [photo1, photo2],
|
||||
location: location,
|
||||
poll: nil,
|
||||
guid: FactoryGirl.generate(:guid),
|
||||
diaspora_id: FactoryGirl.generate(:diaspora_id),
|
||||
public: true,
|
||||
created_at: Time.zone.now,
|
||||
provider_display_name: "something"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
let(:xml) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue