|
41 | 41 | startup.attach_user(founder, :member)
|
42 | 42 | end
|
43 | 43 |
|
44 |
| - it "creates a draft proposal" do |
45 |
| - startup.create_proposal(proposal.attributes) |
46 |
| - |
47 |
| - startup.proposals.count.should == 1 |
48 |
| - startup.proposals.draft.count.should == 1 |
49 |
| - startup.proposals.submitted.count.should == 0 |
50 |
| - startup.proposals.first.proposal_stage_identifier.should == 'draft' |
51 |
| - end |
52 |
| - |
53 | 44 | it "returns the proposal itself" do
|
54 |
| - startup.submit_proposal([], proposal.attributes).should == Proposal.last |
| 45 | + startup.create_proposal([], proposal.attributes).should == Proposal.last |
55 | 46 | end
|
56 | 47 |
|
57 | 48 | it "submits proposal to no investor" do
|
58 |
| - startup.submit_proposal([], proposal.attributes) |
| 49 | + startup.create_proposal([], proposal.attributes) |
59 | 50 |
|
60 | 51 | startup.proposals.count.should == 1
|
61 | 52 | startup.proposals.draft.count.should == 1
|
62 | 53 | startup.proposals.submitted.count.should == 0
|
63 | 54 | end
|
64 | 55 |
|
65 | 56 | it "submits proposal to one investor" do
|
66 |
| - startup.submit_proposal(investor1, proposal.attributes, 'submitted') |
| 57 | + startup.create_proposal(investor1, proposal.attributes, 'submitted') |
67 | 58 |
|
68 | 59 | startup.proposals.count.should == 1
|
69 | 60 | startup.proposals.draft.count.should == 0
|
|
73 | 64 | investor1.inbox_proposals.count.should == 1
|
74 | 65 | startup.proposals.first.proposal_stage_identifier.should == 'submitted'
|
75 | 66 | startup.founder.sent_proposals.first.content.should == I18n.t('text.default_text_for_proposal_review')
|
| 67 | + Message.last.is_with_proposal?.should == true |
| 68 | + Message.last.is_without_proposal?.should == false |
76 | 69 | end
|
77 | 70 |
|
78 | 71 | it "submits proposal to many investors" do
|
79 |
| - startup.submit_proposal([investor1, investor2], proposal.attributes, 'submitted', 'Hey man!') |
| 72 | + startup.create_proposal([investor1, investor2], proposal.attributes, 'submitted', 'Hey man!') |
80 | 73 |
|
81 | 74 | startup.proposals.count.should == 1
|
82 | 75 | startup.proposals.draft.count.should == 0
|
|
92 | 85 | end
|
93 | 86 |
|
94 | 87 | it "edits a proposal" do
|
95 |
| - startup.submit_proposal(investor1, proposal.attributes) |
| 88 | + startup.create_proposal(investor1, proposal.attributes) |
96 | 89 | startup.update_proposal(Proposal.last, investor2, Proposal.make(:pitch => 'Hello world').attributes)
|
97 | 90 |
|
98 | 91 | Proposal.last.pitch.should == 'Hello world'
|
|
105 | 98 | end
|
106 | 99 |
|
107 | 100 | it "edits and submits a proposal" do
|
108 |
| - startup.submit_proposal(investor1, proposal.attributes) |
| 101 | + startup.create_proposal(investor1, proposal.attributes) |
109 | 102 | startup.update_proposal(Proposal.last, investor2, Proposal.make(:pitch => 'Hello world').attributes, 'submitted')
|
110 | 103 |
|
111 | 104 | Proposal.last.pitch.should == 'Hello world'
|
|
118 | 111 | end
|
119 | 112 |
|
120 | 113 | it "archives a proposal message" do
|
121 |
| - startup.submit_proposal(investor1, proposal.attributes) |
| 114 | + startup.create_proposal(investor1, proposal.attributes, 'submitted') |
122 | 115 |
|
123 | 116 | investor1.inbox_proposals.count.should == 1
|
124 | 117 | investor1.archived_proposals.count.should == 0
|
|
135 | 128 |
|
136 | 129 | it "preserves proposal details structure" do
|
137 | 130 | proposal_attributes = proposal.attributes.merge(:pitch => 'Hello world')
|
138 |
| - startup.submit_proposal(investor1, proposal_attributes) |
| 131 | + startup.create_proposal(investor1, proposal_attributes) |
139 | 132 |
|
140 | 133 | Proposal.last.pitch.should == 'Hello world'
|
141 | 134 | end
|
|
0 commit comments