mostrar la tripulacion
This commit is contained in:
parent
0d4b01b2b0
commit
3924237ab0
2 changed files with 3 additions and 0 deletions
|
@ -4,3 +4,4 @@ json.call(barca, :id, :created_at, :nombre, :descripcion)
|
|||
|
||||
json.abordada @current_pirata.barcas.pluck(:id).include?(barca.id)
|
||||
json.eliminable barca.consensos.count.zero?
|
||||
json.tripulacion barca.piratas.count
|
||||
|
|
|
@ -111,6 +111,8 @@ class BarcasControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
body = JSON.parse @response.body
|
||||
assert body['barcas'].first['abordada']
|
||||
assert_equal 1, body['barcas'].first['tripulacion']
|
||||
assert_not body['barcas'].last['abordada']
|
||||
assert_equal 0, body['barcas'].last['tripulacion']
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue