Files
osem/spec/features/user_spec.rb
Henne Vogelsang df0b9ab356 Replace flash helper with "within"
So we can't forget to find "#flash" on the page ever again...
2025-08-06 13:11:48 +02:00

28 lines
602 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
feature User do
let(:admin) { create(:admin) }
let!(:user) { create(:user) }
shared_examples 'admin ability' do
scenario 'edits a user', feature: true, js: true do
visit admin_users_path
within "tr#user_#{user.id}" do
click_on 'Edit'
end
fill_in 'Name', with: 'Edited Name'
click_button 'Update User'
within('#flash') { expect(page).to have_text('Updated Edited Name') }
end
end
describe 'admin' do
before { sign_in admin }
it_behaves_like 'admin ability', :admin
end
end