aboutsummaryrefslogtreecommitdiffstats
path: root/spec/factories/outgoing_messages.rb
blob: d1ed25093f4b47a09ade8860ededd7e9ca23b30e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FactoryGirl.define do

    factory :outgoing_message do
        factory :initial_request do
            ignore do
                status 'ready'
                message_type 'initial_request'
                body 'Some information please'
                what_doing 'normal_sort'
            end
        end
        factory :internal_review_request do
            ignore do
                status 'ready'
                message_type 'followup'
                body 'I want a review'
                what_doing 'internal_review'
            end
        end
        initialize_with { OutgoingMessage.new({ :status => status,
                                                :message_type => message_type,
                                                :body => body,
                                                :what_doing => what_doing }) }
        after_create do |outgoing_message|
            outgoing_message.send_message
        end
    end
    
end