Add additional model and integration tests

This commit adds new tests for a better coverage.

integration/
  * home
  * supplier

models/
  * article
  * delivery
  * group_order_article
  * supplier

also adds a new factory for delivery

Co-authored-by: viehlieb <pf@pragma-shift.net>
Co-authored-by: Tobias Kneuker <tk@pragma-shift.net>
This commit is contained in:
Philipp Rothmann 2022-10-31 16:36:06 +01:00 committed by Patrick Gansterer
parent 9a46640d3b
commit c6560e0cea
8 changed files with 167 additions and 7 deletions

View file

@ -0,0 +1,23 @@
require_relative '../spec_helper'
feature 'my profile page' do
let(:user) { create :user }
before { login user }
describe 'my profile' do
before { visit my_profile_path }
it 'is accessible' do
expect(page).to have_field 'user_first_name'
expect(find_field('user_first_name').value).to eq user.first_name
end
it 'updates first name' do
fill_in 'user_first_name', with: 'foo'
click_button I18n.t('ui.save')
expect(User.find(user.id).first_name).to eq 'foo'
expect(page).to have_selector '.alert-success'
end
end
end