|
142 | 142 | end |
143 | 143 |
|
144 | 144 | describe '.contributions' do |
145 | | - let(:task){create(:task)} |
146 | | - let(:other_task){create(:task)} |
| 145 | + let(:task) { create(:task) } |
| 146 | + let(:other_task) { create(:task) } |
147 | 147 |
|
148 | | - let(:other_contribution){create(:task_contribution, base: other_task)} |
| 148 | + let(:other_contribution) { create(:task_contribution, base: other_task) } |
149 | 149 |
|
150 | 150 | context 'when the task has a contribution' do |
151 | | - let(:contribution){create(:task_contribution, base: task)} |
| 151 | + let(:contribution) { create(:task_contribution, base: task) } |
| 152 | + |
152 | 153 | it 'returns the contribution' do |
153 | 154 | expect(task.contributions).to contain_exactly(contribution) |
154 | 155 | end |
|
160 | 161 | end |
161 | 162 |
|
162 | 163 | context 'when the task is a suggestion' do |
163 | | - let(:other_contribution){create(:task_contribution, suggestion: other_task)} |
| 164 | + let(:other_contribution) { create(:task_contribution, suggestion: other_task) } |
| 165 | + |
164 | 166 | it 'returns an empty array' do |
165 | 167 | expect(other_task.contributions).to be_empty |
166 | 168 | end |
167 | 169 | end |
168 | 170 | end |
169 | | - |
170 | | - |
171 | 171 | end |
172 | 172 |
|
173 | 173 | describe '#duplicate' do |
|
179 | 179 | let(:model_solutions) { build_list(:model_solution, 2) } |
180 | 180 | let(:task_user) { create(:user) } |
181 | 181 | let(:groups) { create_list(:group, 1) } |
182 | | - let(:labels) { create_list(:label, 2)} |
| 182 | + let(:labels) { create_list(:label, 2) } |
183 | 183 |
|
184 | 184 | it 'creates a new task' do |
185 | 185 | expect(duplicate).not_to be task |
|
386 | 386 | it 'does not destroy the contribution' do |
387 | 387 | expect(contribution).not_to be_destroyed |
388 | 388 | end |
389 | | - |
| 389 | + |
390 | 390 | it 'does not destroy the suggestion' do |
391 | 391 | expect(suggestion).not_to be_destroyed |
392 | 392 | end |
|
0 commit comments