hyper-kitten-tables 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +3 -0
- data/lib/hyper-kitten-tables.rb +6 -0
- data/lib/hyper_kitten_tables/components/table.rb +7 -0
- data/lib/hyper_kitten_tables/concerns/table.rb +134 -0
- data/lib/hyper_kitten_tables/engine.rb +5 -0
- data/lib/hyper_kitten_tables/version.rb +3 -0
- data/lib/tasks/tables_tasks.rake +4 -0
- data/spec/components/table_spec.rb +209 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/controllers/pages_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +7 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/hyper_kitten_meow/pages/hardcoded_page.html.haml +4 -0
- data/spec/dummy/app/views/pages/app_hardcoded_page.html.haml +4 -0
- data/spec/dummy/app/views/pages/show.html.haml +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +33 -0
- data/spec/dummy/config/application.rb +26 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +16 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +56 -0
- data/spec/dummy/config/environments/production.rb +93 -0
- data/spec/dummy/config/environments/test.rb +50 -0
- data/spec/dummy/config/initializers/assets.rb +12 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +26 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +43 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/config.ru +6 -0
- data/spec/dummy/db/migrate/20220805173427_create_action_text_tables.action_text.rb +26 -0
- data/spec/dummy/db/migrate/20220805173748_create_active_storage_tables.active_storage.rb +57 -0
- data/spec/dummy/db/schema.rb +134 -0
- data/spec/dummy/db/seeds.rb +23 -0
- data/spec/dummy/log/development.log +12689 -0
- data/spec/dummy/log/test.log +58989 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/storage/it/lb/itlbn65dlnw20cu9ii6epg3qtr0h +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-16-58-13.777.html +148 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-16-59-53.965.html +148 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-00-42.481.html +148 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-01-02.940.html +229 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-03-02.450.html +229 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-03-17.782.html +148 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-03-57.376.html +229 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-07-53.996.html +232 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-13-29.891.html +232 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-13-56.197.html +232 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-15-26.557.html +232 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-14-43-43.563.html +165 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-14-45-19.375.html +157 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.088.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.102.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.116.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.193.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.206.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-26-51.644.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-26-54.957.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-30-28.415.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-30-34.037.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-43-01.197.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-43-04.942.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-45-09.535.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-45-14.082.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-45-26.094.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-45-26.446.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-57-08.858.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-57-11.332.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-58-08.456.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-58-08.832.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-02-35.674.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-02-39.415.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-03-38.082.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-03-38.564.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-08.143.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-08.472.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-34.570.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-40.657.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-52.001.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-52.410.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-06-40.488.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-06-46.796.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-09-28.828.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-09-32.459.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-09-45.931.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-09-46.318.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-12-03.393.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-12-06.113.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-12-11.111.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-12-16.868.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-15-57.176.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-16-03.653.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-29-32.001.html +91 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-29-34.702.html +96 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-11-16-24-42.604.html +85 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-11-16-25-08.753.html +76 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-02-02.769.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-08-16.549.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-09-06.988.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-10-02.456.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-12-58.767.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-13-38.946.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-20-23.040.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-22-40.972.html +31 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-30-50.210.html +31 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-31-41.216.html +31 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-42-03.223.html +31 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-53-14.392.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-52-54.850.html +35 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-53-03.992.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-53-40.077.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-53-55.068.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-54-08.951.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-54-39.523.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-55-46.588.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-56-53.302.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-57-13.712.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-59-55.972.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-10-18-17-04-32.815.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-45-56.483.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-51-45.853.html +54 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-56-35.870.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-58-42.872.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-59-53.565.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-25-51.194.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-27-18.607.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-34-14.915.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-34-23.967.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-35-20.693.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-38-57.780.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-39-59.478.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-40-32.807.html +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-40-42.311.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-41-40.038.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-43-18.794.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-45-22.057.html +9 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-46-07.622.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-46-23.810.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-46-42.443.html +9 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-47-03.378.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-49-38.206.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-49-53.697.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-50-25.359.html +1 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-50-43.146.html +9 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-51-18.812.html +54 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-51-55.591.html +78 -0
- data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-52-42.586.html +78 -0
- data/spec/dummy/tmp/development_secret.txt +1 -0
- data/spec/dummy/tmp/restart.txt +0 -0
- data/spec/features/admin/create_first_user_spec.rb +34 -0
- data/spec/features/admin/menu_management_spec.rb +137 -0
- data/spec/features/admin/page_management_spec.rb +73 -0
- data/spec/features/admin/post_management_spec.rb +80 -0
- data/spec/features/admin/users_management_spec.rb +65 -0
- data/spec/features/display_pages_spec.rb +45 -0
- data/spec/features/display_posts_spec.rb +0 -0
- data/spec/rails_helper.rb +13 -0
- metadata +502 -0
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<section class='new-user'>
|
2
|
+
<h2>Welcome to <span class="translation_missing" title="translation missing: en.hyper_kitten_meow.title">Title</span></h2>
|
3
|
+
<p>Please create your first user account to get started.</p>
|
4
|
+
<form class="simple_form new_user" id="new_user" novalidate="novalidate" action="/hyper-kitten-meow/admin/first_users" accept-charset="UTF-8" method="post"><div class="mb-3 string required user_name"><label class="form-label string required" for="user_name">Name <abbr title="required">*</abbr></label><input class="form-control string required" type="text" name="user[name]" id="user_name" /></div>
|
5
|
+
<div class="mb-3 email required user_email"><label class="form-label email required" for="user_email">Email <abbr title="required">*</abbr></label><input class="form-control string email required" type="email" name="user[email]" id="user_email" /></div>
|
6
|
+
<div class="mb-3 password optional user_password"><label class="form-label password optional" for="user_password">Password</label><input class="form-control password optional" type="password" name="user[password]" id="user_password" /></div>
|
7
|
+
<div class="mb-3 password optional user_password_confirmation"><label class="form-label password optional" for="user_password_confirmation">Password confirmation</label><input class="form-control password optional" type="password" name="user[password_confirmation]" id="user_password_confirmation" /></div>
|
8
|
+
<input type="submit" name="commit" value="Create User" class="btn btn-primary" data-disable-with="Create User" />
|
9
|
+
</form></section>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<section class='new-user'>
|
2
|
+
<h2>Welcome to <span class="translation_missing" title="translation missing: en.hyper_kitten_meow.title">Title</span></h2>
|
3
|
+
<p>Please create your first user account to get started.</p>
|
4
|
+
<form class="simple_form new_user" id="new_user" novalidate="novalidate" action="/hyper-kitten-meow/admin/first_users" accept-charset="UTF-8" method="post"><div class="mb-3 string required user_name"><label class="form-label string required" for="user_name">Name <abbr title="required">*</abbr></label><input class="form-control string required" type="text" name="user[name]" id="user_name" /></div>
|
5
|
+
<div class="mb-3 email required user_email"><label class="form-label email required" for="user_email">Email <abbr title="required">*</abbr></label><input class="form-control string email required" type="email" name="user[email]" id="user_email" /></div>
|
6
|
+
<div class="mb-3 password optional user_password"><label class="form-label password optional" for="user_password">Password</label><input class="form-control password optional" type="password" name="user[password]" id="user_password" /></div>
|
7
|
+
<div class="mb-3 password optional user_password_confirmation"><label class="form-label password optional" for="user_password_confirmation">Password confirmation</label><input class="form-control password optional" type="password" name="user[password_confirmation]" id="user_password_confirmation" /></div>
|
8
|
+
<input type="submit" name="commit" value="Create User" class="btn btn-primary" data-disable-with="Create User" />
|
9
|
+
</form></section>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<html><body>You are being <a href="http://www.example.com/hyper-kitten-meow/admin">redirected</a>.</body></html>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<section class='new-user'>
|
2
|
+
<h2>Welcome to <span class="translation_missing" title="translation missing: en.hyper_kitten_meow.title">Title</span></h2>
|
3
|
+
<p>Please create your first user account to get started.</p>
|
4
|
+
<form class="simple_form new_user" id="new_user" novalidate="novalidate" action="/hyper-kitten-meow/admin/first_users" accept-charset="UTF-8" method="post"><div class="mb-3 string required user_name"><label class="form-label string required" for="user_name">Name <abbr title="required">*</abbr></label><input class="form-control string required" type="text" name="user[name]" id="user_name" /></div>
|
5
|
+
<div class="mb-3 email required user_email"><label class="form-label email required" for="user_email">Email <abbr title="required">*</abbr></label><input class="form-control string email required" type="email" name="user[email]" id="user_email" /></div>
|
6
|
+
<div class="mb-3 password optional user_password"><label class="form-label password optional" for="user_password">Password</label><input class="form-control password optional" type="password" name="user[password]" id="user_password" /></div>
|
7
|
+
<div class="mb-3 password optional user_password_confirmation"><label class="form-label password optional" for="user_password_confirmation">Password confirmation</label><input class="form-control password optional" type="password" name="user[password_confirmation]" id="user_password_confirmation" /></div>
|
8
|
+
<input type="submit" name="commit" value="Create User" class="btn btn-primary" data-disable-with="Create User" />
|
9
|
+
</form></section>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html class='h-100'>
|
3
|
+
<head>
|
4
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
5
|
+
<title>Your Title</title>
|
6
|
+
<link rel="stylesheet" crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" />
|
7
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/trix/1.3.1/trix.min.css" />
|
8
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css" />
|
9
|
+
<script type="importmap" data-turbo-track="reload">{
|
10
|
+
"imports": {
|
11
|
+
"bootstrap": "https://ga.jspm.io/npm:bootstrap@5.2.2/dist/js/bootstrap.esm.js",
|
12
|
+
"@popperjs/core": "https://ga.jspm.io/npm:@popperjs/core@2.11.6/lib/index.js",
|
13
|
+
"@hotwired/stimulus": "/assets/stimulus.min-aab608fae21f2c1bac54028a5ea332762374c7d5.js",
|
14
|
+
"@hotwired/stimulus-loading": "/assets/stimulus-loading-e367296568a6df104dc84fcfe5d1aafae5076fc0.js",
|
15
|
+
"sortablejs": "https://ga.jspm.io/npm:sortablejs@1.15.0/modular/sortable.esm.js",
|
16
|
+
"trix": "https://ga.jspm.io/npm:trix@2.0.0-beta.0/dist/trix.js",
|
17
|
+
"hyper_kitten_meow/application": "/assets/hyper_kitten_meow/application-233450bbc5437a34f4fbb75045e1b0ae337c879e.js",
|
18
|
+
"@rails/activestorage": "https://ga.jspm.io/npm:@rails/activestorage@7.0.4/app/assets/javascripts/activestorage.esm.js",
|
19
|
+
"@rails/actiontext": "https://ga.jspm.io/npm:@rails/actiontext@7.0.4/app/assets/javascripts/actiontext.js",
|
20
|
+
"hyper_kitten_meow/controllers/application": "/assets/hyper_kitten_meow/controllers/application-a45fcffa4627508814a7727d04043357d1dcedbe.js",
|
21
|
+
"hyper_kitten_meow/controllers": "/assets/hyper_kitten_meow/controllers/index-75d6331f3e6ac38720595fca892d1179c84dd34e.js",
|
22
|
+
"hyper_kitten_meow/controllers/menu_items_form_controller": "/assets/hyper_kitten_meow/controllers/menu_items_form_controller-82ceff726898a80786aca24b9ae62b5862bd41b0.js"
|
23
|
+
}
|
24
|
+
}</script>
|
25
|
+
<link rel="modulepreload" href="/assets/stimulus.min-aab608fae21f2c1bac54028a5ea332762374c7d5.js">
|
26
|
+
<link rel="modulepreload" href="/assets/stimulus-loading-e367296568a6df104dc84fcfe5d1aafae5076fc0.js">
|
27
|
+
<script src="/assets/es-module-shims.min-f7a11f41d669b1f9ca6432c0ba58580ba2b4087a.js" async="async" data-turbo-track="reload"></script>
|
28
|
+
<script type="module">import "application"</script>
|
29
|
+
<script type="module">import "hyper_kitten_meow/application"</script>
|
30
|
+
|
31
|
+
</head>
|
32
|
+
<body class='h-100'>
|
33
|
+
<div class='container-fluid h-100'>
|
34
|
+
<div class='row h-100'>
|
35
|
+
<nav class='col-md-3 col-lg-2 d-md-block sidebar bg-dark text-white d-flex flex-column'>
|
36
|
+
<h3 class='mb-3 mt-3'>Your Title</h3>
|
37
|
+
<hr>
|
38
|
+
</nav>
|
39
|
+
<div class='col-md-9 col-lg-10 mt-3 px-4'>
|
40
|
+
<section class='new-user'>
|
41
|
+
<h2>Welcome to <span class="translation_missing" title="translation missing: en.hyper_kitten_meow.title">Title</span></h2>
|
42
|
+
<p>Please create your first user account to get started.</p>
|
43
|
+
<form class="simple_form new_user" id="new_user" novalidate="novalidate" action="/hyper-kitten-meow/admin/first_users" accept-charset="UTF-8" method="post"><div class="mb-3 string required user_name"><label class="form-label string required" for="user_name">Name <abbr title="required">*</abbr></label><input class="form-control string required" type="text" name="user[name]" id="user_name" /></div>
|
44
|
+
<div class="mb-3 email required user_email"><label class="form-label email required" for="user_email">Email <abbr title="required">*</abbr></label><input class="form-control string email required" type="email" name="user[email]" id="user_email" /></div>
|
45
|
+
<div class="mb-3 password optional user_password"><label class="form-label password optional" for="user_password">Password</label><input class="form-control password optional" type="password" name="user[password]" id="user_password" /></div>
|
46
|
+
<div class="mb-3 password optional user_password_confirmation"><label class="form-label password optional" for="user_password_confirmation">Password confirmation</label><input class="form-control password optional" type="password" name="user[password_confirmation]" id="user_password_confirmation" /></div>
|
47
|
+
<input type="submit" name="commit" value="Create User" class="btn btn-primary" data-disable-with="Create User" />
|
48
|
+
</form></section>
|
49
|
+
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
</body>
|
54
|
+
</html>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html class='h-100'>
|
3
|
+
<head>
|
4
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
5
|
+
<title>Your Title</title>
|
6
|
+
<link rel="stylesheet" crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" />
|
7
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/trix/1.3.1/trix.min.css" />
|
8
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css" />
|
9
|
+
<script type="importmap" data-turbo-track="reload">{
|
10
|
+
"imports": {
|
11
|
+
"bootstrap": "https://ga.jspm.io/npm:bootstrap@5.2.2/dist/js/bootstrap.esm.js",
|
12
|
+
"@popperjs/core": "https://ga.jspm.io/npm:@popperjs/core@2.11.6/lib/index.js",
|
13
|
+
"@hotwired/stimulus": "/assets/stimulus.min-aab608fae21f2c1bac54028a5ea332762374c7d5.js",
|
14
|
+
"@hotwired/stimulus-loading": "/assets/stimulus-loading-e367296568a6df104dc84fcfe5d1aafae5076fc0.js",
|
15
|
+
"sortablejs": "https://ga.jspm.io/npm:sortablejs@1.15.0/modular/sortable.esm.js",
|
16
|
+
"trix": "https://ga.jspm.io/npm:trix@2.0.0-beta.0/dist/trix.js",
|
17
|
+
"hyper_kitten_meow/application": "/assets/hyper_kitten_meow/application-233450bbc5437a34f4fbb75045e1b0ae337c879e.js",
|
18
|
+
"@rails/activestorage": "https://ga.jspm.io/npm:@rails/activestorage@7.0.4/app/assets/javascripts/activestorage.esm.js",
|
19
|
+
"@rails/actiontext": "https://ga.jspm.io/npm:@rails/actiontext@7.0.4/app/assets/javascripts/actiontext.js",
|
20
|
+
"hyper_kitten_meow/controllers/application": "/assets/hyper_kitten_meow/controllers/application-a45fcffa4627508814a7727d04043357d1dcedbe.js",
|
21
|
+
"hyper_kitten_meow/controllers": "/assets/hyper_kitten_meow/controllers/index-75d6331f3e6ac38720595fca892d1179c84dd34e.js",
|
22
|
+
"hyper_kitten_meow/controllers/menu_items_form_controller": "/assets/hyper_kitten_meow/controllers/menu_items_form_controller-82ceff726898a80786aca24b9ae62b5862bd41b0.js"
|
23
|
+
}
|
24
|
+
}</script>
|
25
|
+
<link rel="modulepreload" href="/assets/stimulus.min-aab608fae21f2c1bac54028a5ea332762374c7d5.js">
|
26
|
+
<link rel="modulepreload" href="/assets/stimulus-loading-e367296568a6df104dc84fcfe5d1aafae5076fc0.js">
|
27
|
+
<script src="/assets/es-module-shims.min-f7a11f41d669b1f9ca6432c0ba58580ba2b4087a.js" async="async" data-turbo-track="reload"></script>
|
28
|
+
<script type="module">import "application"</script>
|
29
|
+
<script type="module">import "hyper_kitten_meow/application"</script>
|
30
|
+
|
31
|
+
</head>
|
32
|
+
<body class='h-100'>
|
33
|
+
<div class='container-fluid h-100'>
|
34
|
+
<div class='row h-100'>
|
35
|
+
<nav class='col-md-3 col-lg-2 d-md-block sidebar bg-dark text-white d-flex flex-column'>
|
36
|
+
<h3 class='mb-3 mt-3'>Your Title</h3>
|
37
|
+
<hr>
|
38
|
+
<ul class='nav nav-pills flex-column mb-auto'>
|
39
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/posts">Posts</a></li>
|
40
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/pages">Pages</a></li>
|
41
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/menus">Menus</a></li>
|
42
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/tags">Tags</a></li>
|
43
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/users">Users</a></li>
|
44
|
+
</ul>
|
45
|
+
<hr>
|
46
|
+
<a class="nav-link d-flex align-items-center text-white text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" href="#"><strong>Andrew</strong>
|
47
|
+
</a><ul class='dropdown-menu dropdown-menu-dark text-small shadow'>
|
48
|
+
<li><a class="dropdown-item" href="/hyper-kitten-meow/admin/logout">Log Out</a></li>
|
49
|
+
</ul>
|
50
|
+
</nav>
|
51
|
+
<div class='col-md-9 col-lg-10 mt-3 px-4'>
|
52
|
+
<section>
|
53
|
+
<div class='d-flex justify-content-between'>
|
54
|
+
<h2>New Post</h2>
|
55
|
+
<div class='action'>
|
56
|
+
<a class="btn btn-secondary" href="/hyper-kitten-meow/admin/posts">Back to Posts</a>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
<form class="simple_form new_post" id="new_post" novalidate="novalidate" action="/hyper-kitten-meow/admin/posts" accept-charset="UTF-8" method="post"><div class="mb-3 string required post_title"><label class="form-label string required" for="post_title">Title <abbr title="required">*</abbr></label><input class="form-control string required" type="text" name="post[title]" id="post_title" /></div>
|
60
|
+
<div class="mb-3 text optional post_summary"><label class="form-label text optional" for="post_summary">Summary</label><textarea class="form-control text optional" name="post[summary]" id="post_summary">
|
61
|
+
</textarea></div>
|
62
|
+
<div class="mb-3 rich_text_area required post_body"><label class="form-label rich_text_area required" for="post_body">Body <abbr title="required">*</abbr></label><input type="hidden" name="post[body]" id="post_body_trix_input_post" autocomplete="off" /><trix-editor class="form-control rich_text_area required" id="post_body" input="post_body_trix_input_post" data-direct-upload-url="http://www.example.com/rails/active_storage/direct_uploads" data-blob-url-template="http://www.example.com/rails/active_storage/blobs/redirect/:signed_id/:filename"></trix-editor></div>
|
63
|
+
<div class="mb-3 select required post_user"><label class="form-label select required" for="post_user_id">User <abbr title="required">*</abbr></label><select class="form-select select required" name="post[user_id]" id="post_user_id"><option value="" label=" "></option>
|
64
|
+
<option value="52">Andrew</option>
|
65
|
+
<option value="53">Josh</option></select></div>
|
66
|
+
<div class="mb-3 string required post_slug"><label class="form-label string required" for="post_slug">Slug <abbr title="required">*</abbr></label><input class="form-control string required" type="text" name="post[slug]" id="post_slug" /></div>
|
67
|
+
<fieldset class="mb-3 check_boxes optional post_tags"><legend class="col-form-label pt-0">Tags</legend><div class="row"></div><input type="hidden" name="post[tag_ids][]" value="" autocomplete="off" /><div class="form-check"><input class="form-check-input check_boxes optional" type="checkbox" value="1" name="post[tag_ids][]" id="post_tag_ids_1" /><label class="form-check-label collection_check_boxes" for="post_tag_ids_1">coffee</label></div></fieldset>
|
68
|
+
<hr>
|
69
|
+
<fieldset class="mb-3 boolean optional post_published"><div class="form-check"><input name="post[published]" type="hidden" value="0" autocomplete="off" /><input class="form-check-input boolean optional" type="checkbox" value="1" name="post[published]" id="post_published" /><label class="form-check-label boolean optional" for="post_published">Published</label></div></fieldset>
|
70
|
+
<input type="submit" name="commit" value="Create Post" class="btn btn-primary" data-disable-with="Create Post" />
|
71
|
+
|
72
|
+
</form></section>
|
73
|
+
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
</body>
|
78
|
+
</html>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html class='h-100'>
|
3
|
+
<head>
|
4
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
5
|
+
<title>Your Title</title>
|
6
|
+
<link rel="stylesheet" crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" />
|
7
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/trix/1.3.1/trix.min.css" />
|
8
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css" />
|
9
|
+
<script type="importmap" data-turbo-track="reload">{
|
10
|
+
"imports": {
|
11
|
+
"bootstrap": "https://ga.jspm.io/npm:bootstrap@5.2.2/dist/js/bootstrap.esm.js",
|
12
|
+
"@popperjs/core": "https://ga.jspm.io/npm:@popperjs/core@2.11.6/lib/index.js",
|
13
|
+
"@hotwired/stimulus": "/assets/stimulus.min-aab608fae21f2c1bac54028a5ea332762374c7d5.js",
|
14
|
+
"@hotwired/stimulus-loading": "/assets/stimulus-loading-e367296568a6df104dc84fcfe5d1aafae5076fc0.js",
|
15
|
+
"sortablejs": "https://ga.jspm.io/npm:sortablejs@1.15.0/modular/sortable.esm.js",
|
16
|
+
"trix": "https://ga.jspm.io/npm:trix@2.0.0-beta.0/dist/trix.js",
|
17
|
+
"hyper_kitten_meow/application": "/assets/hyper_kitten_meow/application-233450bbc5437a34f4fbb75045e1b0ae337c879e.js",
|
18
|
+
"@rails/activestorage": "https://ga.jspm.io/npm:@rails/activestorage@7.0.4/app/assets/javascripts/activestorage.esm.js",
|
19
|
+
"@rails/actiontext": "https://ga.jspm.io/npm:@rails/actiontext@7.0.4/app/assets/javascripts/actiontext.js",
|
20
|
+
"hyper_kitten_meow/controllers/application": "/assets/hyper_kitten_meow/controllers/application-a45fcffa4627508814a7727d04043357d1dcedbe.js",
|
21
|
+
"hyper_kitten_meow/controllers": "/assets/hyper_kitten_meow/controllers/index-75d6331f3e6ac38720595fca892d1179c84dd34e.js",
|
22
|
+
"hyper_kitten_meow/controllers/menu_items_form_controller": "/assets/hyper_kitten_meow/controllers/menu_items_form_controller-82ceff726898a80786aca24b9ae62b5862bd41b0.js"
|
23
|
+
}
|
24
|
+
}</script>
|
25
|
+
<link rel="modulepreload" href="/assets/stimulus.min-aab608fae21f2c1bac54028a5ea332762374c7d5.js">
|
26
|
+
<link rel="modulepreload" href="/assets/stimulus-loading-e367296568a6df104dc84fcfe5d1aafae5076fc0.js">
|
27
|
+
<script src="/assets/es-module-shims.min-f7a11f41d669b1f9ca6432c0ba58580ba2b4087a.js" async="async" data-turbo-track="reload"></script>
|
28
|
+
<script type="module">import "application"</script>
|
29
|
+
<script type="module">import "hyper_kitten_meow/application"</script>
|
30
|
+
|
31
|
+
</head>
|
32
|
+
<body class='h-100'>
|
33
|
+
<div class='container-fluid h-100'>
|
34
|
+
<div class='row h-100'>
|
35
|
+
<nav class='col-md-3 col-lg-2 d-md-block sidebar bg-dark text-white d-flex flex-column'>
|
36
|
+
<h3 class='mb-3 mt-3'>Your Title</h3>
|
37
|
+
<hr>
|
38
|
+
<ul class='nav nav-pills flex-column mb-auto'>
|
39
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/posts">Posts</a></li>
|
40
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/pages">Pages</a></li>
|
41
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/menus">Menus</a></li>
|
42
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/tags">Tags</a></li>
|
43
|
+
<li class='nav-item'><a class="nav-link text-white" href="/hyper-kitten-meow/admin/users">Users</a></li>
|
44
|
+
</ul>
|
45
|
+
<hr>
|
46
|
+
<a class="nav-link d-flex align-items-center text-white text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" href="#"><strong>Andrew</strong>
|
47
|
+
</a><ul class='dropdown-menu dropdown-menu-dark text-small shadow'>
|
48
|
+
<li><a class="dropdown-item" href="/hyper-kitten-meow/admin/logout">Log Out</a></li>
|
49
|
+
</ul>
|
50
|
+
</nav>
|
51
|
+
<div class='col-md-9 col-lg-10 mt-3 px-4'>
|
52
|
+
<section>
|
53
|
+
<div class='d-flex justify-content-between'>
|
54
|
+
<h2>New Post</h2>
|
55
|
+
<div class='action'>
|
56
|
+
<a class="btn btn-secondary" href="/hyper-kitten-meow/admin/posts">Back to Posts</a>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
<form class="simple_form new_post" id="new_post" novalidate="novalidate" action="/hyper-kitten-meow/admin/posts" accept-charset="UTF-8" method="post"><div class="mb-3 string required post_title"><label class="form-label string required" for="post_title">Title <abbr title="required">*</abbr></label><input class="form-control string required" type="text" name="post[title]" id="post_title" /></div>
|
60
|
+
<div class="mb-3 text optional post_summary"><label class="form-label text optional" for="post_summary">Summary</label><textarea class="form-control text optional" name="post[summary]" id="post_summary">
|
61
|
+
</textarea></div>
|
62
|
+
<div class="mb-3 rich_text_area required post_body"><label class="form-label rich_text_area required" for="post_body">Body <abbr title="required">*</abbr></label><input type="hidden" name="post[body]" id="post_body_trix_input_post" autocomplete="off" /><trix-editor class="form-control rich_text_area required" id="post_body" input="post_body_trix_input_post" data-direct-upload-url="http://www.example.com/rails/active_storage/direct_uploads" data-blob-url-template="http://www.example.com/rails/active_storage/blobs/redirect/:signed_id/:filename"></trix-editor></div>
|
63
|
+
<div class="mb-3 select required post_user"><label class="form-label select required" for="post_user_id">User <abbr title="required">*</abbr></label><select class="form-select select required" name="post[user_id]" id="post_user_id"><option value="" label=" "></option>
|
64
|
+
<option value="87">Andrew</option>
|
65
|
+
<option value="88">Josh</option></select></div>
|
66
|
+
<div class="mb-3 string required post_slug"><label class="form-label string required" for="post_slug">Slug <abbr title="required">*</abbr></label><input class="form-control string required" type="text" name="post[slug]" id="post_slug" /></div>
|
67
|
+
<fieldset class="mb-3 check_boxes optional post_tags"><legend class="col-form-label pt-0">Tags</legend><div class="row"></div><input type="hidden" name="post[tag_ids][]" value="" autocomplete="off" /><div class="form-check"><input class="form-check-input check_boxes optional" type="checkbox" value="5" name="post[tag_ids][]" id="post_tag_ids_5" /><label class="form-check-label collection_check_boxes" for="post_tag_ids_5">coffee</label></div></fieldset>
|
68
|
+
<hr>
|
69
|
+
<fieldset class="mb-3 boolean optional post_published"><div class="form-check"><input name="post[published]" type="hidden" value="0" autocomplete="off" /><input class="form-check-input boolean optional" type="checkbox" value="1" name="post[published]" id="post_published" /><label class="form-check-label boolean optional" for="post_published">Published</label></div></fieldset>
|
70
|
+
<input type="submit" name="commit" value="Create Post" class="btn btn-primary" data-disable-with="Create Post" />
|
71
|
+
|
72
|
+
</form></section>
|
73
|
+
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
</body>
|
78
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
5c4cd38aca1b322d26ba7abba365d900103096af59b0dfe84dafc25bea38598d0039d7ff7870677ff05d7c323da185e60559555ae8db2a23463c2dcae7bfedde
|
File without changes
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require "rails_helper"
|
2
|
+
|
3
|
+
RSpec.feature "Creating the first user", :type => :feature do
|
4
|
+
context "when there are no users" do
|
5
|
+
scenario "trying to login redirects to the first user form" do
|
6
|
+
visit hyper_kitten_meow.admin_login_path
|
7
|
+
|
8
|
+
expect(page).to have_current_path(hyper_kitten_meow.new_admin_first_user_path)
|
9
|
+
end
|
10
|
+
|
11
|
+
scenario "visitor can create first user" do
|
12
|
+
visit hyper_kitten_meow.new_admin_first_user_path
|
13
|
+
|
14
|
+
fill_in "Name", with: "David Byrne"
|
15
|
+
fill_in "Email", with: "test@test.com"
|
16
|
+
fill_in "Password", with: "password"
|
17
|
+
fill_in "Password confirmation", with: "password"
|
18
|
+
click_on "Create User"
|
19
|
+
|
20
|
+
expect(page).to have_current_path(hyper_kitten_meow.admin_login_path)
|
21
|
+
expect(page).to have_text("User successfully created. Please log in.")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context "when there are users" do
|
26
|
+
scenario "trying to create a first user redirects to the login page" do
|
27
|
+
create(:user)
|
28
|
+
|
29
|
+
visit hyper_kitten_meow.new_admin_first_user_path
|
30
|
+
|
31
|
+
expect(page).to have_current_path(hyper_kitten_meow.admin_login_path)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
require "rails_helper"
|
2
|
+
|
3
|
+
RSpec.feature "Menu management", :type => :feature do
|
4
|
+
scenario "user can view posts" do
|
5
|
+
user = create_user_and_login
|
6
|
+
menu = create(:menu, name: "My Title")
|
7
|
+
|
8
|
+
visit hyper_kitten_meow.admin_menus_path
|
9
|
+
|
10
|
+
expect(page).to have_text("My Title")
|
11
|
+
end
|
12
|
+
|
13
|
+
scenario "user can create a menu" do
|
14
|
+
user = create_user_and_login
|
15
|
+
static_page = create(:page, title: "My Page")
|
16
|
+
|
17
|
+
visit hyper_kitten_meow.new_admin_menu_path
|
18
|
+
|
19
|
+
fill_in "Name", with: "Hello World!"
|
20
|
+
select "My Page", from: "Page"
|
21
|
+
fill_in "Title", with: "My Title"
|
22
|
+
check "New window"
|
23
|
+
click_button "Create Menu"
|
24
|
+
|
25
|
+
expect(page).to have_text("Menu was successfully created.")
|
26
|
+
expect(page).to have_text("Hello World!")
|
27
|
+
menu = HyperKittenMeow::Menu.last
|
28
|
+
menu_item = menu.menu_items.first
|
29
|
+
expect(menu_item.title).to eq("My Title")
|
30
|
+
expect(menu_item.page).to eq(static_page)
|
31
|
+
expect(menu_item.new_window).to eq(true)
|
32
|
+
expect(menu_item.position).to eq(1)
|
33
|
+
end
|
34
|
+
|
35
|
+
scenario "user can edit menus" do
|
36
|
+
user = create_user_and_login(name: 'Andrew')
|
37
|
+
menu = create(:menu, name: "My Menu")
|
38
|
+
static_page = create(:page, title: "My Page")
|
39
|
+
|
40
|
+
visit hyper_kitten_meow.edit_admin_menu_path(menu)
|
41
|
+
|
42
|
+
expect(page).to have_text("My Menu")
|
43
|
+
|
44
|
+
fill_in "Name", with: "Hello World!"
|
45
|
+
select "My Page", from: "Page"
|
46
|
+
fill_in "Title", with: "My Title"
|
47
|
+
click_on "Update Menu"
|
48
|
+
|
49
|
+
expect(page).to have_text("Menu was successfully updated.")
|
50
|
+
expect(page).to have_text("Hello World!")
|
51
|
+
menu.reload
|
52
|
+
menu_item = menu.menu_items.first
|
53
|
+
expect(menu_item.title).to eq("My Title")
|
54
|
+
expect(menu_item.page).to eq(static_page)
|
55
|
+
expect(menu_item.position).to eq(1)
|
56
|
+
end
|
57
|
+
|
58
|
+
scenario "user can edit menus and add menu items", js: true do
|
59
|
+
user = create_user_and_login(name: 'Andrew')
|
60
|
+
menu = create(:menu, name: "My Menu")
|
61
|
+
static_page1 = create(:page, title: "My Page 1")
|
62
|
+
static_page2 = create(:page, title: "My Page 2")
|
63
|
+
|
64
|
+
visit hyper_kitten_meow.edit_admin_menu_path(menu)
|
65
|
+
|
66
|
+
expect(page).to have_text("My Menu")
|
67
|
+
|
68
|
+
click_on "Add Menu Item"
|
69
|
+
expect(page).to have_selector(".menu-item", count: 2)
|
70
|
+
menu_items = all(".menu-item")
|
71
|
+
within menu_items.first do
|
72
|
+
select "My Page 1", from: "Page"
|
73
|
+
fill_in "Title", with: "First Item"
|
74
|
+
end
|
75
|
+
within menu_items.last do
|
76
|
+
select "My Page 2", from: "Page"
|
77
|
+
fill_in "Title", with: "Second Item"
|
78
|
+
end
|
79
|
+
click_on "Update Menu"
|
80
|
+
|
81
|
+
expect(page).to have_text("My Menu")
|
82
|
+
menu.reload
|
83
|
+
expect(menu.menu_items.size).to eq(2)
|
84
|
+
menu_item = menu.menu_items.first
|
85
|
+
expect(menu_item.title).to eq("First Item")
|
86
|
+
expect(menu_item.page).to eq(static_page1)
|
87
|
+
expect(menu_item.position).to eq(1)
|
88
|
+
menu_item2 = menu.menu_items.last
|
89
|
+
expect(menu_item2.title).to eq("Second Item")
|
90
|
+
expect(menu_item2.page).to eq(static_page2)
|
91
|
+
expect(menu_item2.position).to eq(2)
|
92
|
+
end
|
93
|
+
|
94
|
+
scenario "user can edit menus and remove menu items", js: true do
|
95
|
+
user = create_user_and_login(name: 'Andrew')
|
96
|
+
menu = create(:menu, name: "My Menu")
|
97
|
+
static_page1 = create(:page, title: "My Page 1")
|
98
|
+
static_page2 = create(:page, title: "My Page 2")
|
99
|
+
create(:menu_item, menu: menu, page: static_page1, title: "First Item", position: 1)
|
100
|
+
create(:menu_item, menu: menu, page: static_page2, title: "Second Item", position: 2)
|
101
|
+
|
102
|
+
visit hyper_kitten_meow.edit_admin_menu_path(menu)
|
103
|
+
|
104
|
+
expect(page).to have_text("My Menu")
|
105
|
+
expect(page).to have_selector(".menu-item", count: 2)
|
106
|
+
menu_items = all(".menu-item")
|
107
|
+
within menu_items.first do
|
108
|
+
click_on "Remove"
|
109
|
+
end
|
110
|
+
click_on "Update Menu"
|
111
|
+
|
112
|
+
expect(page).to have_text("My Menu")
|
113
|
+
menu.reload
|
114
|
+
expect(menu.menu_items.size).to eq(1)
|
115
|
+
menu_item = menu.menu_items.first
|
116
|
+
expect(menu_item.title).to eq("Second Item")
|
117
|
+
expect(menu_item.page).to eq(static_page2)
|
118
|
+
expect(menu_item.position).to eq(1)
|
119
|
+
end
|
120
|
+
|
121
|
+
scenario "user can delete a menu" do
|
122
|
+
user = create_user_and_login(name: 'Andrew')
|
123
|
+
menu = create(:menu, name: "My Menu")
|
124
|
+
static_page1 = create(:page, title: "My Page 1")
|
125
|
+
static_page2 = create(:page, title: "My Page 2")
|
126
|
+
create(:menu_item, menu: menu, page: static_page1, title: "First Item", position: 1)
|
127
|
+
create(:menu_item, menu: menu, page: static_page2, title: "Second Item", position: 2)
|
128
|
+
|
129
|
+
visit hyper_kitten_meow.admin_menus_path
|
130
|
+
|
131
|
+
click_on "Delete"
|
132
|
+
|
133
|
+
expect(page).to have_text("Menu was successfully deleted.")
|
134
|
+
expect(page).to_not have_text("My Menu")
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require "rails_helper"
|
2
|
+
|
3
|
+
RSpec.feature "Page management", :type => :feature do
|
4
|
+
scenario "user can view pages" do
|
5
|
+
user = create_user_and_login
|
6
|
+
static_page = create(:page, title: "My Title")
|
7
|
+
|
8
|
+
visit hyper_kitten_meow.admin_pages_path
|
9
|
+
|
10
|
+
expect(page).to have_text("My Title")
|
11
|
+
end
|
12
|
+
|
13
|
+
it "paginates pages" do
|
14
|
+
create_user_and_login
|
15
|
+
paginates(factory: :page, increment: 10, selector: '.page') do
|
16
|
+
visit hyper_kitten_meow.admin_pages_path
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
scenario "user can paginate through the pages" do
|
21
|
+
create_user_and_login
|
22
|
+
pages = FactoryBot.create_list(:page, 11)
|
23
|
+
|
24
|
+
visit hyper_kitten_meow.admin_pages_path
|
25
|
+
expect(page).to have_selector('.page', count: 10)
|
26
|
+
click_on('Next')
|
27
|
+
|
28
|
+
expect(page).to have_selector('.page', count: 1)
|
29
|
+
end
|
30
|
+
|
31
|
+
scenario "user can edit pages", js: true do
|
32
|
+
user = create_user_and_login
|
33
|
+
static_page = create(:page, title: "My Title")
|
34
|
+
|
35
|
+
visit hyper_kitten_meow.edit_admin_page_path(static_page)
|
36
|
+
|
37
|
+
expect(page).to have_text("My Title")
|
38
|
+
|
39
|
+
fill_in "Title", with: "Hello World!"
|
40
|
+
fill_in "Slug", with: "my slug"
|
41
|
+
fill_in_rich_text_area "Body", with: "Fuzzy waffle!"
|
42
|
+
check "Published"
|
43
|
+
click_on "Update Page"
|
44
|
+
|
45
|
+
expect(current_path).to eq(hyper_kitten_meow.admin_pages_path)
|
46
|
+
expect(page).to have_text("Hello World!")
|
47
|
+
expect(page).to have_text("my-slug")
|
48
|
+
end
|
49
|
+
|
50
|
+
scenario "user can create pages", js: true do
|
51
|
+
user = create_user_and_login
|
52
|
+
|
53
|
+
visit hyper_kitten_meow.new_admin_page_path
|
54
|
+
fill_in "Title", with: "Hello World!"
|
55
|
+
fill_in_rich_text_area "Body", with: "Fuzzy waffle!"
|
56
|
+
check "Published"
|
57
|
+
click_on "Create Page"
|
58
|
+
|
59
|
+
expect(current_path).to eq(hyper_kitten_meow.admin_pages_path)
|
60
|
+
expect(page).to have_text("Hello World!")
|
61
|
+
expect(page).to have_text("Page successfully created.")
|
62
|
+
end
|
63
|
+
|
64
|
+
scenario "user can fix invalid pages", js: true do
|
65
|
+
user = create_user_and_login
|
66
|
+
visit hyper_kitten_meow.new_admin_page_path
|
67
|
+
|
68
|
+
fill_in "Title", with: ""
|
69
|
+
click_on "Create Page"
|
70
|
+
|
71
|
+
expect(page).to have_text("Title can't be blank")
|
72
|
+
end
|
73
|
+
end
|