mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 01:35:34 +08:00
API GET repository stock column output fix [SCI-6550] (#4030)
* Add include stock unit items to Stock column get [SCI-6550] * Fix stock column test [SCI-6550] * Fix hound [SCI-6550]
This commit is contained in:
parent
1a2a58ff5f
commit
54474b2bba
3 changed files with 6 additions and 5 deletions
|
@ -34,7 +34,7 @@ module Api
|
|||
def show
|
||||
render jsonapi: @inventory_column,
|
||||
serializer: InventoryColumnSerializer,
|
||||
include: :inventory_list_items
|
||||
include: %i(inventory_list_items repository_stock_unit_items)
|
||||
end
|
||||
|
||||
def update
|
||||
|
|
|
@ -165,7 +165,7 @@ class Extends
|
|||
'RepositoryChecklistValue' => 'checklist',
|
||||
'RepositoryAssetValue' => 'file',
|
||||
'RepositoryStatusValue' => 'status',
|
||||
'RepositoryStockValue' => 'stock_value' }
|
||||
'RepositoryStockValue' => 'stock' }
|
||||
|
||||
OMNIAUTH_PROVIDERS = %i(linkedin customazureactivedirectory okta)
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ RSpec.describe 'Api::V1::InventoryColumnsController', type: :request do
|
|||
{ type: 'inventory_columns',
|
||||
attributes: {
|
||||
name: Faker::Name.unique.name,
|
||||
data_type: 'stock_value',
|
||||
data_type: 'stock',
|
||||
metadata: {
|
||||
decimals: 3
|
||||
}
|
||||
|
@ -434,8 +434,9 @@ RSpec.describe 'Api::V1::InventoryColumnsController', type: :request do
|
|||
team_id: @teams.first.id,
|
||||
inventory_id: @teams.first.repositories.second.id
|
||||
), headers: @valid_headers
|
||||
expect(response).to have_http_status(400)
|
||||
expect(RepositoryColumn.where(id: deleted_id)).to exist
|
||||
expect(response).to have_http_status(200)
|
||||
expect(RepositoryColumn.where(id: deleted_id)).to_not exist
|
||||
expect(RepositoryCell.where(repository_column: deleted_id).count).to equal 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue