Add more onliner before in specs

This commit is contained in:
François Turbelin
2020-10-11 20:12:41 +02:00
parent 7ad6e1b76a
commit 11f1f6cff1
3 changed files with 6 additions and 16 deletions

View File

@@ -116,9 +116,7 @@ describe DfcProvider::Api::CatalogItemsController, type: :controller do
context 'with an enterprise' do
context 'given with an id' do
before do
api_get :show,
enterprise_id: enterprise.id,
id: variant.id
api_get :show, enterprise_id: enterprise.id, id: variant.id
end
it 'is successful' do
@@ -126,10 +124,8 @@ describe DfcProvider::Api::CatalogItemsController, type: :controller do
end
it 'renders the required content' do
expect(response.body)
.to include('dfc:CatalogItem')
expect(response.body)
.to include("offers/#{variant.id}")
expect(response.body).to include('dfc:CatalogItem')
expect(response.body).to include("offers/#{variant.id}")
end
end

View File

@@ -21,10 +21,7 @@ describe DfcProvider::Api::PersonsController, type: :controller do
end
context 'given with an accessible id' do
before do
api_get :show,
id: user.id
end
before { api_get :show, id: user.id }
it 'is successful' do
expect(response.status).to eq 200

View File

@@ -26,9 +26,7 @@ describe DfcProvider::Api::SuppliedProductsController, type: :controller do
context 'with an enterprise' do
context 'given with an id' do
before do
api_get :show,
enterprise_id: 'default',
id: variant.id
api_get :show, enterprise_id: 'default', id: variant.id
end
it 'is successful' do
@@ -36,8 +34,7 @@ describe DfcProvider::Api::SuppliedProductsController, type: :controller do
end
it 'renders the required content' do
expect(response.body)
.to include(variant.name)
expect(response.body).to include(variant.name)
end
end