fix rubocop and add translations

This commit is contained in:
viehlieb 2023-02-20 21:44:57 +01:00
parent 346e985c49
commit 126015ca67
8 changed files with 20 additions and 17 deletions

View file

@ -1,9 +1,9 @@
require_relative '../spec_helper'
feature ArticlesController do
let(:user) { create :user, groups: [create(:workgroup, role_article_meta: true)] }
let(:supplier) { create :supplier }
let!(:article_category) { create :article_category }
let(:user) { create(:user, groups: [create(:workgroup, role_article_meta: true)]) }
let(:supplier) { create(:supplier) }
let!(:article_category) { create(:article_category) }
before { login user }
@ -18,7 +18,7 @@ feature ArticlesController do
it 'can create a new article' do
click_on I18n.t('articles.index.new')
expect(page).to have_selector('form#new_article')
article = build :article, supplier: supplier, article_category: article_category
article = build(:article, supplier: supplier, article_category: article_category)
within('#new_article') do
fill_in 'article_name', :with => article.name
fill_in 'article_unit', :with => article.unit
@ -65,7 +65,7 @@ feature ArticlesController do
end
describe "can update existing article" do
let!(:article) { create :article, supplier: supplier, name: 'Foobar', order_number: 1, unit: '250 g' }
let!(:article) { create(:article, supplier: supplier, name: 'Foobar', order_number: 1, unit: '250 g') }
it do
find('input[type="submit"]').click
@ -80,7 +80,7 @@ feature ArticlesController do
describe "handles missing data" do
it do
find('input[type="submit"]').click # to overview
element = find('#new_articles__price')
element = find_by_id('new_articles__price')
element.fill_in with: ""
find('input[type="submit"]').click # missing category, re-show form
expect(find('tr.alert')).to be_present
@ -93,7 +93,7 @@ feature ArticlesController do
end
describe "can remove an existing article" do
let!(:article) { create :article, supplier: supplier, name: 'Foobar', order_number: 99999 }
let!(:article) { create(:article, supplier: supplier, name: 'Foobar', order_number: 99999) }
it do
check('articles_outlist_absent')
@ -107,7 +107,7 @@ feature ArticlesController do
end
describe "can convert units when updating" do
let!(:article) { create :article, supplier: supplier, order_number: 1, unit: '250 g' }
let!(:article) { create(:article, supplier: supplier, order_number: 1, unit: '250 g') }
it do
check('articles_convert_units')