|
13 | 13 | fake_colabora_response = double('faraday_response', status: 201, body: json_proposal_response)
|
14 | 14 |
|
15 | 15 | url = 'http://localhost:3000/api/v1/proposals'
|
16 |
| - headers = { 'Content-Type': 'application/json' } |
17 |
| - allow(Faraday).to receive(:post).with(url, invitation_request_params['data'], headers) |
| 16 | + allow(Faraday).to receive(:post).with(url, invitation_request_params['data']) |
18 | 17 | .and_return(fake_colabora_response)
|
19 | 18 |
|
20 | 19 | get '/api/v1/projects/request_invitation', params: { invitation_request_id: invitation_request.id }.as_json
|
|
34 | 33 | project_id: invitation_request.project_id } } }.as_json
|
35 | 34 |
|
36 | 35 | url = 'http://localhost:3000/api/v1/proposals'
|
37 |
| - headers = { 'Content-Type': 'application/json' } |
38 | 36 | fake_colabora_response_body = { 'errors': ['Projeto não encontrado'] }.as_json
|
39 | 37 | fake_colabora_response = double('faraday_response', status: 404, body: fake_colabora_response_body)
|
40 |
| - allow(Faraday).to receive(:post).with(url, invitation_request_params['data'], headers) |
| 38 | + allow(Faraday).to receive(:post).with(url, invitation_request_params['data']) |
41 | 39 | .and_return(fake_colabora_response)
|
42 | 40 |
|
43 | 41 | get '/api/v1/projects/request_invitation', params: { invitation_request_id: invitation_request.id }.as_json
|
|
58 | 56 | project_id: invitation_request.project_id } } }.as_json
|
59 | 57 |
|
60 | 58 | url = 'http://localhost:3000/api/v1/proposals'
|
61 |
| - headers = { 'Content-Type': 'application/json' } |
62 | 59 | fake_colabora_response_body = { 'errors': ['Usuário já faz parte deste projeto'] }.as_json
|
63 | 60 | fake_colabora_response = double('faraday_response', status: 409, body: fake_colabora_response_body)
|
64 |
| - allow(Faraday).to receive(:post).with(url, invitation_request_params['data'], headers) |
| 61 | + allow(Faraday).to receive(:post).with(url, invitation_request_params['data']) |
65 | 62 | .and_return(fake_colabora_response)
|
66 | 63 |
|
67 | 64 | get '/api/v1/projects/request_invitation', params: { invitation_request_id: invitation_request.id }.as_json
|
|
82 | 79 | project_id: invitation_request.project_id } } }.as_json
|
83 | 80 |
|
84 | 81 | url = 'http://localhost:3000/api/v1/proposals'
|
85 |
| - headers = { 'Content-Type': 'application/json' } |
86 | 82 | fake_colabora_response_body = { 'errors': ['Erro interno de servidor.'] }.as_json
|
87 | 83 | fake_colabora_response = double('faraday_response', status: 500, body: fake_colabora_response_body)
|
88 |
| - allow(Faraday).to receive(:post).with(url, invitation_request_params['data'], headers) |
| 84 | + allow(Faraday).to receive(:post).with(url, invitation_request_params['data']) |
89 | 85 | .and_return(fake_colabora_response)
|
90 | 86 |
|
91 | 87 | get '/api/v1/projects/request_invitation', params: { invitation_request_id: invitation_request.id }.as_json
|
|
106 | 102 | project_id: invitation_request.project_id } } }.as_json
|
107 | 103 |
|
108 | 104 | url = 'http://localhost:3000/api/v1/proposals'
|
109 |
| - headers = { 'Content-Type': 'application/json' } |
110 |
| - allow(Faraday).to receive(:post).with(url, invitation_request_params['data'], headers) |
| 105 | + allow(Faraday).to receive(:post).with(url, invitation_request_params['data']) |
111 | 106 | .and_raise(ActiveRecord::ConnectionNotEstablished)
|
112 | 107 |
|
113 | 108 | get '/api/v1/projects/request_invitation', params: { invitation_request_id: invitation_request.id }.as_json
|
|
0 commit comments