foodsoft/spec/integration/home_spec.rb
Philipp Rothmann c6560e0cea 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>
2022-11-27 12:39:57 +01:00

23 lines
583 B
Ruby

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