fix articles controller test ActiveModell::Error
This commit is contained in:
parent
e8d229b538
commit
c94b98835c
1 changed files with 1 additions and 1 deletions
|
@ -264,7 +264,7 @@ describe ArticlesController, type: :controller do
|
||||||
it 'does not update articles if article with same name exists' do
|
it 'does not update articles if article with same name exists' do
|
||||||
get_with_supplier :update_synchronized, params: { articles: { article_a.id => { unit: '2000 g' }, article_b.id => { name: 'AAAA' } } }
|
get_with_supplier :update_synchronized, params: { articles: { article_a.id => { unit: '2000 g' }, article_b.id => { name: 'AAAA' } } }
|
||||||
error_array = [assigns(:updated_articles).first.errors.first, assigns(:updated_articles).last.errors.first]
|
error_array = [assigns(:updated_articles).first.errors.first, assigns(:updated_articles).last.errors.first]
|
||||||
expect(error_array).to include([:name, 'name is already taken'])
|
expect(error_array).to include(ActiveModel::Error)
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(:success)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue