Skip to content

Commit

Permalink
Add nested Profile resource to generated app
Browse files Browse the repository at this point in the history
  • Loading branch information
hasghari committed May 5, 2024
1 parent a63e74c commit 6ed5a79
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions spec/support/templates/admin/profiles.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true
ActiveAdmin.register Profile do
menu parent: 'Users'
permit_params :user_id, :bio
end
3 changes: 3 additions & 0 deletions spec/support/templates/policies/profile_policy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# frozen_string_literal: true
class ProfilePolicy < ApplicationPolicy
end
6 changes: 4 additions & 2 deletions spec/unit/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

describe "files in load path" do
it "it should load sorted files" do
expect(application.files.map { |f| File.basename(f) }).to eq(%w(admin_users.rb dashboard.rb stores.rb))
expect(application.files.map { |f| File.basename(f) }).to eq %w(admin_users.rb dashboard.rb profiles.rb stores.rb)
end

it "should load files in the first level directory" do
Expand Down Expand Up @@ -103,7 +103,9 @@
begin
FileUtils.mkdir_p(test_dir)
FileUtils.touch(test_file)
expect(application.files.map { |f| File.basename(f) }).to eq(%w(posts.rb admin_users.rb dashboard.rb stores.rb))
expect(application.files.map { |f| File.basename(f) }).to(
eq(%w(posts.rb admin_users.rb dashboard.rb profiles.rb stores.rb))
)
ensure
FileUtils.remove_entry_secure(test_dir, force: true)
end
Expand Down

0 comments on commit 6ed5a79

Please sign in to comment.