-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from dkniffin/add-test-application
Add test application
- Loading branch information
Showing
85 changed files
with
1,812 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow uses actions that are not certified by GitHub. They are | ||
# provided by a third-party and are governed by separate terms of service, | ||
# privacy policy, and support documentation. | ||
# | ||
# This workflow will install a prebuilt Ruby version, install dependencies, and | ||
# run tests and linters. | ||
name: "Ruby on Rails CI" | ||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
RAILS_ENV: test | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
# Add or replace dependency steps here | ||
- name: Install Ruby and gems | ||
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 | ||
with: | ||
bundler-cache: true | ||
# Add or replace database setup steps here | ||
- name: Set up database schema | ||
run: cd spec/dummy && bundle exec rails db:schema:load | ||
# Add or replace test runners here | ||
- name: Run tests | ||
run: bundle exec rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
source 'https://rubygems.org' | ||
source "https://rubygems.org" | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruby-3.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# README | ||
|
||
This README would normally document whatever steps are necessary to get the | ||
application up and running. | ||
|
||
Things you may want to cover: | ||
|
||
* Ruby version | ||
|
||
* System dependencies | ||
|
||
* Configuration | ||
|
||
* Database creation | ||
|
||
* Database initialization | ||
|
||
* How to run the test suite | ||
|
||
* Services (job queues, cache servers, search engines, etc.) | ||
|
||
* Deployment instructions | ||
|
||
* ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require_relative "config/application" | ||
|
||
Rails.application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
ActiveAdmin.register_page "Dashboard" do | ||
menu priority: 1, label: proc { I18n.t("active_admin.dashboard") } | ||
|
||
content title: proc { I18n.t("active_admin.dashboard") } do | ||
div class: "blank_slate_container", id: "dashboard_default_message" do | ||
span class: "blank_slate" do | ||
span I18n.t("active_admin.dashboard_welcome.welcome") | ||
small I18n.t("active_admin.dashboard_welcome.call_to_action") | ||
end | ||
end | ||
|
||
# Here is an example of a simple dashboard with columns and panels. | ||
# | ||
# columns do | ||
# column do | ||
# panel "Recent Posts" do | ||
# ul do | ||
# Post.recent(5).map do |post| | ||
# li link_to(post.title, admin_post_path(post)) | ||
# end | ||
# end | ||
# end | ||
# end | ||
|
||
# column do | ||
# panel "Info" do | ||
# para "Welcome to ActiveAdmin." | ||
# end | ||
# end | ||
# end | ||
end # content | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveAdmin.register Item do | ||
permit_params :id, :name, :description, :position, :item_queue_id | ||
|
||
reorderable | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ActiveAdmin.register ItemQueue do | ||
show do |item_queue| | ||
attributes_table do | ||
row :id | ||
row :created_at | ||
row :updated_at | ||
end | ||
|
||
reorderable_table_for item_queue.items do | ||
column :name | ||
column :description | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//= link_tree ../images | ||
//= link_directory ../stylesheets .css |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//= require active_admin/base | ||
//= require activeadmin_reorderable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Sass variable overrides must be declared before loading up Active Admin's styles. | ||
// | ||
// To view the variables that Active Admin provides, take a look at | ||
// `app/assets/stylesheets/active_admin/mixins/_variables.scss` in the | ||
// Active Admin source. | ||
// | ||
// For example, to change the sidebar width: | ||
// $sidebar-width: 242px; | ||
|
||
// Active Admin's got SASS! | ||
@import "active_admin/mixins"; | ||
@import "active_admin/base"; | ||
|
||
// Overriding any non-variable Sass must be done after the fact. | ||
// For example, to change the default status-tag color: | ||
// | ||
// .status_tag { background: #6090DB; } | ||
|
||
@import "activeadmin_reorderable"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* This is a manifest file that'll be compiled into application.css, which will include all the files | ||
* listed below. | ||
* | ||
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's | ||
* vendor/assets/stylesheets directory can be referenced here using a relative path. | ||
* | ||
* You're free to add application-wide styles to this file and they'll appear at the bottom of the | ||
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS | ||
* files in this directory. Styles in this file should be added after the last require_* statement. | ||
* It is generally better to create a new file per style scope. | ||
* | ||
*= require_tree . | ||
*= require_self | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class ApplicationController < ActionController::Base | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module ApplicationHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This file is automatically compiled by Webpack, along with any other files | ||
// present in this directory. You're encouraged to place your actual application logic in | ||
// a relevant structure within app/javascript and only use these pack files to reference | ||
// that code so it'll be compiled. | ||
|
||
import Rails from "@rails/ujs" | ||
|
||
Rails.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class ApplicationJob < ActiveJob::Base | ||
# Automatically retry jobs that encountered a deadlock | ||
# retry_on ActiveRecord::Deadlocked | ||
|
||
# Most jobs are safe to ignore if the underlying records are no longer available | ||
# discard_on ActiveJob::DeserializationError | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class ApplicationMailer < ActionMailer::Base | ||
default from: 'from@example.com' | ||
layout 'mailer' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class ApplicationRecord < ActiveRecord::Base | ||
self.abstract_class = true | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require "acts_as_list" | ||
|
||
class Item < ApplicationRecord | ||
belongs_to :item_queue | ||
acts_as_list scope: :item_queue | ||
|
||
def self.ransackable_attributes(auth_object = nil) | ||
["created_at", "description", "id", "name", "position", "updated_at"] | ||
end | ||
|
||
def self.ransackable_associations(auth_object = nil) | ||
["item_queue"] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class ItemQueue < ApplicationRecord | ||
has_many :items, -> { order(position: :asc) } | ||
|
||
def self.ransackable_attributes(auth_object = nil) | ||
["created_at", "id", "updated_at"] | ||
end | ||
|
||
def self.ransackable_associations(auth_object = nil) | ||
["items"] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Dummy</title> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<%= csrf_meta_tags %> | ||
<%= csp_meta_tag %> | ||
<%= stylesheet_link_tag 'application', media: 'all' %> | ||
<%= javascript_pack_tag 'application' %> | ||
</head> | ||
|
||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<style> | ||
/* Email styles need to be inline */ | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= yield %> |
Oops, something went wrong.