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
|
module DiasporaFederation
|
||||||
describe Entities::Conversation do
|
describe Entities::Conversation do
|
||||||
before do
|
|
||||||
@datetime = DateTime.now.utc
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:msg1) { FactoryGirl.build(:message_entity) }
|
let(:msg1) { FactoryGirl.build(:message_entity) }
|
||||||
let(:msg2) { FactoryGirl.build(:message_entity) }
|
let(:msg2) { FactoryGirl.build(:message_entity) }
|
||||||
let(:data) {
|
let(:data) {
|
||||||
{guid: FactoryGirl.generate(:guid),
|
FactoryGirl.attributes_for(:conversation_entity).merge!(
|
||||||
subject: "very interesting conversation subject",
|
messages: [msg1, msg2],
|
||||||
created_at: @datetime,
|
participant_ids: "#{FactoryGirl.generate(:diaspora_id)};#{FactoryGirl.generate(:diaspora_id)}"
|
||||||
messages: [msg1, msg2],
|
)
|
||||||
diaspora_id: FactoryGirl.generate(:diaspora_id),
|
|
||||||
participant_ids: "#{FactoryGirl.generate(:diaspora_id)};#{FactoryGirl.generate(:diaspora_id)}"}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let(:xml) {
|
let(:xml) {
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,12 @@ module DiasporaFederation
|
||||||
let(:photo2) { FactoryGirl.build(:photo_entity) }
|
let(:photo2) { FactoryGirl.build(:photo_entity) }
|
||||||
let(:location) { FactoryGirl.build(:location_entity) }
|
let(:location) { FactoryGirl.build(:location_entity) }
|
||||||
let(:data) {
|
let(:data) {
|
||||||
{
|
FactoryGirl.attributes_for(:status_message_entity).merge!(
|
||||||
raw_message: "this is such an interesting text",
|
|
||||||
photos: [photo1, photo2],
|
photos: [photo1, photo2],
|
||||||
location: location,
|
location: location,
|
||||||
poll: nil,
|
poll: nil,
|
||||||
guid: FactoryGirl.generate(:guid),
|
|
||||||
diaspora_id: FactoryGirl.generate(:diaspora_id),
|
|
||||||
public: true,
|
|
||||||
created_at: Time.zone.now,
|
|
||||||
provider_display_name: "something"
|
provider_display_name: "something"
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
let(:xml) {
|
let(:xml) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue