Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .bundler-audit.yml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
ignore: []
ignore:
- GHSA-qmpg-8xg6-ph5q # action_text-trix 2.1.16 — update to >= 2.1.17
- GHSA-57hq-95w6-v4fc # devise 5.0.2 — update to >= 5.0.3

13 changes: 13 additions & 0 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,17 @@
</div>
<% end %>
</div>
<% if Rails.env.development? %>
<section class="dev-only" style="background-color: white; color: black; width: 30%; padding: 20px; margin-left: 20px; border-radius: 8px;">
<h3>Development-only Users</h3>
<p>These users are only available after running <code>rails db:seed</code> locally:</p>
<ul>
<li>Admin User: [email protected]</li>
<li>Owner User: [email protected]</li>
<li>Viewer User: [email protected]</li>
<li>Manager User: [email protected]</li>
</ul>
<p> The password for each is <code>password123</code>. These accounts are intended for testing and development purposes only and should not be used in production environments. </p>
</section>
<% end %>
</div>
38 changes: 33 additions & 5 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,38 @@
SoftwareType.create(title: name, description: desc)
end

# Create test user and skip email validation
test_user = User.new(first_name: 'Test', last_name: 'User', email: '[email protected]')
test_user.save(validate: false)

# Create development-only test users for each role
if Rails.env.development?
User.find_or_create_by(email: '[email protected]') do |user|
user.first_name = 'Admin'
user.last_name = 'User'
user.role = 'root_admin'
user.password = 'password123'
user.password_confirmation = 'password123'
end
User.find_or_create_by(email: '[email protected]') do |user|
user.first_name = 'Owner'
user.last_name = 'User'
user.role = 'owner'
user.password = 'password123'
user.password_confirmation = 'password123'
end
User.find_or_create_by(email: '[email protected]') do |user|
user.first_name = 'Viewer'
user.last_name = 'User'
user.role = 'viewer'
user.password = 'password123'
user.password_confirmation = 'password123'
end
User.find_or_create_by(email: '[email protected]') do |user|
user.first_name = 'Manager'
user.last_name = 'User'
user.role = 'manager'
user.password = 'password123'
user.password_confirmation = 'password123'
end
else
puts "Skipping user creation in #{Rails.env} environment"
end
# Create Software record

SoftwareRecord.create!(title: 'test', software_type: SoftwareType.find(1), vendor_record: VendorRecord.find(1), status: Status.find(1), hosting_environment: HostingEnvironment.first, description: 'test', created_by: 'test_user')
Loading