Skip to content

Commit

Permalink
Add test of admin editing a user
Browse files Browse the repository at this point in the history
Fails with:

    1) User admin behaves like admin ability edits a user
       Failure/Error: raise ActionController::MissingExactTemplate, message

       ActionController::MissingExactTemplate:
         Admin::UsersController#edit is missing a template for request formats: text/html

re openSUSE#2975
  • Loading branch information
AndrewKvalheim committed Sep 12, 2022
1 parent cdbecde commit 2cb770a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion spec/features/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@
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'
expect(flash).to include('Updated Edited Name')
end
end

describe 'admin' do
before { sign_in admin }

it_behaves_like 'admin ability', :admin
end
end

0 comments on commit 2cb770a

Please sign in to comment.