diff --git a/cajeh-backend/cajehform/Gemfile b/cajeh-backend/cajehform/Gemfile deleted file mode 100644 index bc86c8aa1..000000000 --- a/cajeh-backend/cajehform/Gemfile +++ /dev/null @@ -1,42 +0,0 @@ -source 'https://rubygems.org' -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - -ruby '2.6.3' - -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 6.0.0' -gem 'pg' -# Use Puma as the app server -gem 'puma', '~> 3.11' -# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -# gem 'jbuilder', '~> 2.7' -# Use Redis adapter to run Action Cable in production -# gem 'redis', '~> 4.0' -# Use Active Model has_secure_password -# gem 'bcrypt', '~> 3.1.7' - -# Use Active Storage variant -# gem 'image_processing', '~> 1.2' - -# Reduces boot times through caching; required in config/boot.rb -gem 'bootsnap', '>= 1.4.2', require: false - -# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible -# gem 'rack-cors' - -group :development, :test do - gem 'pry' - gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] - gem 'rspec-rails' - gem 'rubocop' -end - -group :development do - gem 'listen', '>= 3.0.5', '< 3.2' - # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem 'spring' - gem 'spring-watcher-listen', '~> 2.0.0' -end - -# Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/cajeh-backend/cajehform/Gemfile.lock b/cajeh-backend/cajehform/Gemfile.lock deleted file mode 100644 index 009a43316..000000000 --- a/cajeh-backend/cajehform/Gemfile.lock +++ /dev/null @@ -1,205 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - actioncable (6.0.0) - actionpack (= 6.0.0) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (6.0.0) - actionpack (= 6.0.0) - activejob (= 6.0.0) - activerecord (= 6.0.0) - activestorage (= 6.0.0) - activesupport (= 6.0.0) - mail (>= 2.7.1) - actionmailer (6.0.0) - actionpack (= 6.0.0) - actionview (= 6.0.0) - activejob (= 6.0.0) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (6.0.0) - actionview (= 6.0.0) - activesupport (= 6.0.0) - rack (~> 2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.0) - actionpack (= 6.0.0) - activerecord (= 6.0.0) - activestorage (= 6.0.0) - activesupport (= 6.0.0) - nokogiri (>= 1.8.5) - actionview (6.0.0) - activesupport (= 6.0.0) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.0) - activesupport (= 6.0.0) - globalid (>= 0.3.6) - activemodel (6.0.0) - activesupport (= 6.0.0) - activerecord (6.0.0) - activemodel (= 6.0.0) - activesupport (= 6.0.0) - activestorage (6.0.0) - actionpack (= 6.0.0) - activejob (= 6.0.0) - activerecord (= 6.0.0) - marcel (~> 0.3.1) - activesupport (6.0.0) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.1, >= 2.1.8) - ast (2.4.0) - bootsnap (1.4.5) - msgpack (~> 1.0) - builder (3.2.3) - byebug (11.0.1) - coderay (1.1.2) - concurrent-ruby (1.1.5) - crass (1.0.4) - diff-lcs (1.3) - erubi (1.9.0) - ffi (1.11.1) - globalid (0.4.2) - activesupport (>= 4.2.0) - i18n (1.7.0) - concurrent-ruby (~> 1.0) - jaro_winkler (1.5.3) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - loofah (2.3.0) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) - method_source (0.9.2) - mimemagic (0.3.3) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - minitest (5.12.2) - msgpack (1.3.1) - nio4r (2.5.2) - nokogiri (1.10.4) - mini_portile2 (~> 2.4.0) - parallel (1.18.0) - parser (2.6.5.0) - ast (~> 2.4.0) - pg (1.1.4) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - puma (3.12.1) - rack (2.0.7) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (6.0.0) - actioncable (= 6.0.0) - actionmailbox (= 6.0.0) - actionmailer (= 6.0.0) - actionpack (= 6.0.0) - actiontext (= 6.0.0) - actionview (= 6.0.0) - activejob (= 6.0.0) - activemodel (= 6.0.0) - activerecord (= 6.0.0) - activestorage (= 6.0.0) - activesupport (= 6.0.0) - bundler (>= 1.3.0) - railties (= 6.0.0) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) - loofah (~> 2.3) - railties (6.0.0) - actionpack (= 6.0.0) - activesupport (= 6.0.0) - method_source - rake (>= 0.8.7) - thor (>= 0.20.3, < 2.0) - rainbow (3.0.0) - rake (13.0.0) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) - ffi (~> 1.0) - rspec-core (3.8.2) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.6) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-rails (3.8.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.3) - rubocop (0.75.0) - jaro_winkler (~> 1.5.1) - parallel (~> 1.10) - parser (>= 2.6) - rainbow (>= 2.2.2, < 4.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) - ruby-progressbar (1.10.1) - ruby_dep (1.5.0) - spring (2.1.0) - spring-watcher-listen (2.0.1) - listen (>= 2.7, < 4.0) - spring (>= 1.2, < 3.0) - sprockets (3.7.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - thor (0.20.3) - thread_safe (0.3.6) - tzinfo (1.2.5) - thread_safe (~> 0.1) - unicode-display_width (1.6.0) - websocket-driver (0.7.1) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) - zeitwerk (2.1.10) - -PLATFORMS - ruby - -DEPENDENCIES - bootsnap (>= 1.4.2) - byebug - listen (>= 3.0.5, < 3.2) - pg - pry - puma (~> 3.11) - rails (~> 6.0.0) - rspec-rails - rubocop - spring - spring-watcher-listen (~> 2.0.0) - tzinfo-data - -RUBY VERSION - ruby 2.6.3p62 - -BUNDLED WITH - 1.17.2 diff --git a/cajeh-backend/cajehform/Rakefile b/cajeh-backend/cajehform/Rakefile deleted file mode 100644 index e85f91391..000000000 --- a/cajeh-backend/cajehform/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -# 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 diff --git a/cajeh-backend/cajehform/app/channels/application_cable/channel.rb b/cajeh-backend/cajehform/app/channels/application_cable/channel.rb deleted file mode 100644 index d67269728..000000000 --- a/cajeh-backend/cajehform/app/channels/application_cable/channel.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Channel < ActionCable::Channel::Base - end -end diff --git a/cajeh-backend/cajehform/app/channels/application_cable/connection.rb b/cajeh-backend/cajehform/app/channels/application_cable/connection.rb deleted file mode 100644 index 0ff5442f4..000000000 --- a/cajeh-backend/cajehform/app/channels/application_cable/connection.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Connection < ActionCable::Connection::Base - end -end diff --git a/cajeh-backend/cajehform/app/controllers/application_controller.rb b/cajeh-backend/cajehform/app/controllers/application_controller.rb deleted file mode 100644 index 4ac8823b0..000000000 --- a/cajeh-backend/cajehform/app/controllers/application_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ApplicationController < ActionController::API -end diff --git a/cajeh-backend/cajehform/app/controllers/concerns/.keep b/cajeh-backend/cajehform/app/controllers/concerns/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/cajeh-backend/cajehform/app/controllers/users_controller.rb b/cajeh-backend/cajehform/app/controllers/users_controller.rb deleted file mode 100644 index 3f0461991..000000000 --- a/cajeh-backend/cajehform/app/controllers/users_controller.rb +++ /dev/null @@ -1,44 +0,0 @@ -class UsersController < ApplicationController - before_action :set_user, only: [:show, :update, :destroy] - - def index - @users = User.all - - render json: @users - end - - def show - render json: @user - end - - def create - @user = User.new(user_params) - - if @user.save - render json: @user, status: :created, location: @user - else - render json: @user.errors, status: :unprocessable_entity - end - end - - def update - if @user.update(user_params) - render json: @user - else - render json: @user.errors, status: :unprocessable_entity - end - end - - def destroy - @user.destroy - end - - private - def set_user - @user = User.find(params[:id]) - end - - def user_params - params.require(:user).permit(:email, :password, :name, :phone_number, :collab, :leader, :password_confirmation) - end -end diff --git a/cajeh-backend/cajehform/app/jobs/application_job.rb b/cajeh-backend/cajehform/app/jobs/application_job.rb deleted file mode 100644 index d394c3d10..000000000 --- a/cajeh-backend/cajehform/app/jobs/application_job.rb +++ /dev/null @@ -1,7 +0,0 @@ -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 diff --git a/cajeh-backend/cajehform/app/mailers/application_mailer.rb b/cajeh-backend/cajehform/app/mailers/application_mailer.rb deleted file mode 100644 index 286b2239d..000000000 --- a/cajeh-backend/cajehform/app/mailers/application_mailer.rb +++ /dev/null @@ -1,4 +0,0 @@ -class ApplicationMailer < ActionMailer::Base - default from: 'from@example.com' - layout 'mailer' -end diff --git a/cajeh-backend/cajehform/app/models/application_record.rb b/cajeh-backend/cajehform/app/models/application_record.rb deleted file mode 100644 index 10a4cba84..000000000 --- a/cajeh-backend/cajehform/app/models/application_record.rb +++ /dev/null @@ -1,3 +0,0 @@ -class ApplicationRecord < ActiveRecord::Base - self.abstract_class = true -end diff --git a/cajeh-backend/cajehform/app/models/concerns/.keep b/cajeh-backend/cajehform/app/models/concerns/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/cajeh-backend/cajehform/app/models/user.rb b/cajeh-backend/cajehform/app/models/user.rb deleted file mode 100644 index 379658a50..000000000 --- a/cajeh-backend/cajehform/app/models/user.rb +++ /dev/null @@ -1,2 +0,0 @@ -class User < ApplicationRecord -end diff --git a/cajeh-backend/cajehform/app/views/layouts/mailer.html.erb b/cajeh-backend/cajehform/app/views/layouts/mailer.html.erb deleted file mode 100644 index cbd34d2e9..000000000 --- a/cajeh-backend/cajehform/app/views/layouts/mailer.html.erb +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - <%= yield %> - - diff --git a/cajeh-backend/cajehform/app/views/layouts/mailer.text.erb b/cajeh-backend/cajehform/app/views/layouts/mailer.text.erb deleted file mode 100644 index 37f0bddbd..000000000 --- a/cajeh-backend/cajehform/app/views/layouts/mailer.text.erb +++ /dev/null @@ -1 +0,0 @@ -<%= yield %> diff --git a/cajeh-backend/cajehform/bin/bundle b/cajeh-backend/cajehform/bin/bundle deleted file mode 100755 index 524dfd3f2..000000000 --- a/cajeh-backend/cajehform/bin/bundle +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -# -# This file was generated by Bundler. -# -# The application 'bundle' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "rubygems" - -m = Module.new do - module_function - - def invoked_as_script? - File.expand_path($0) == File.expand_path(__FILE__) - end - - def env_var_version - ENV["BUNDLER_VERSION"] - end - - def cli_arg_version - return unless invoked_as_script? # don't want to hijack other binstubs - return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` - bundler_version = nil - update_index = nil - ARGV.each_with_index do |a, i| - if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN - bundler_version = a - end - next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ - bundler_version = $1 || ">= 0.a" - update_index = i - end - bundler_version - end - - def gemfile - gemfile = ENV["BUNDLE_GEMFILE"] - return gemfile if gemfile && !gemfile.empty? - - File.expand_path("../../Gemfile", __FILE__) - end - - def lockfile - lockfile = - case File.basename(gemfile) - when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) - else "#{gemfile}.lock" - end - File.expand_path(lockfile) - end - - def lockfile_version - return unless File.file?(lockfile) - lockfile_contents = File.read(lockfile) - return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ - Regexp.last_match(1) - end - - def bundler_version - @bundler_version ||= begin - env_var_version || cli_arg_version || - lockfile_version || "#{Gem::Requirement.default}.a" - end - end - - def load_bundler! - ENV["BUNDLE_GEMFILE"] ||= gemfile - - # must dup string for RG < 1.8 compatibility - activate_bundler(bundler_version.dup) - end - - def activate_bundler(bundler_version) - if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0") - bundler_version = "< 2" - end - gem_error = activation_error_handling do - gem "bundler", bundler_version - end - return if gem_error.nil? - require_error = activation_error_handling do - require "bundler/version" - end - return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION)) - warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`" - exit 42 - end - - def activation_error_handling - yield - nil - rescue StandardError, LoadError => e - e - end -end - -m.load_bundler! - -if m.invoked_as_script? - load Gem.bin_path("bundler", "bundle") -end diff --git a/cajeh-backend/cajehform/bin/rails b/cajeh-backend/cajehform/bin/rails deleted file mode 100755 index 5badb2fde..000000000 --- a/cajeh-backend/cajehform/bin/rails +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env ruby -begin - load File.expand_path('../spring', __FILE__) -rescue LoadError => e - raise unless e.message.include?('spring') -end -APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/cajeh-backend/cajehform/bin/rake b/cajeh-backend/cajehform/bin/rake deleted file mode 100755 index d87d5f578..000000000 --- a/cajeh-backend/cajehform/bin/rake +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env ruby -begin - load File.expand_path('../spring', __FILE__) -rescue LoadError => e - raise unless e.message.include?('spring') -end -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/cajeh-backend/cajehform/bin/setup b/cajeh-backend/cajehform/bin/setup deleted file mode 100755 index 0e39e8cb1..000000000 --- a/cajeh-backend/cajehform/bin/setup +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env ruby -require 'fileutils' - -# path to your application root. -APP_ROOT = File.expand_path('..', __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -FileUtils.chdir APP_ROOT do - # This script is a way to setup or update your development environment automatically. - # This script is idempotent, so that you can run it at anytime and get an expectable outcome. - # Add necessary setup steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') - - # puts "\n== Copying sample files ==" - # unless File.exist?('config/database.yml') - # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' - # end - - puts "\n== Preparing database ==" - system! 'bin/rails db:prepare' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end diff --git a/cajeh-backend/cajehform/bin/spring b/cajeh-backend/cajehform/bin/spring deleted file mode 100755 index d89ee495f..000000000 --- a/cajeh-backend/cajehform/bin/spring +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby - -# This file loads Spring without using Bundler, in order to be fast. -# It gets overwritten when you run the `spring binstub` command. - -unless defined?(Spring) - require 'rubygems' - require 'bundler' - - lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) - spring = lockfile.specs.detect { |spec| spec.name == 'spring' } - if spring - Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path - gem 'spring', spring.version - require 'spring/binstub' - end -end diff --git a/cajeh-backend/cajehform/config.ru b/cajeh-backend/cajehform/config.ru deleted file mode 100644 index f7ba0b527..000000000 --- a/cajeh-backend/cajehform/config.ru +++ /dev/null @@ -1,5 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require_relative 'config/environment' - -run Rails.application diff --git a/cajeh-backend/cajehform/config/application.rb b/cajeh-backend/cajehform/config/application.rb deleted file mode 100644 index ff9e42e21..000000000 --- a/cajeh-backend/cajehform/config/application.rb +++ /dev/null @@ -1,37 +0,0 @@ -require_relative 'boot' - -require "rails" -# Pick the frameworks you want: -require "active_model/railtie" -require "active_job/railtie" -require "active_record/railtie" -require "active_storage/engine" -require "action_controller/railtie" -require "action_mailer/railtie" -require "action_mailbox/engine" -require "action_text/engine" -require "action_view/railtie" -require "action_cable/engine" -# require "sprockets/railtie" -require "rails/test_unit/railtie" - -# Require the gems listed in Gemfile, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(*Rails.groups) - -module Cajehform - class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 6.0 - - # Settings in config/environments/* take precedence over those specified here. - # Application configuration can go into files in config/initializers - # -- all .rb files in that directory are automatically loaded after loading - # the framework and any gems in your application. - - # Only loads a smaller set of middleware suitable for API only apps. - # Middleware like session, flash, cookies can be added back manually. - # Skip views, helpers and assets when generating a new resource. - config.api_only = true - end -end diff --git a/cajeh-backend/cajehform/config/boot.rb b/cajeh-backend/cajehform/config/boot.rb deleted file mode 100644 index b9e460cef..000000000 --- a/cajeh-backend/cajehform/config/boot.rb +++ /dev/null @@ -1,4 +0,0 @@ -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) - -require 'bundler/setup' # Set up gems listed in the Gemfile. -require 'bootsnap/setup' # Speed up boot time by caching expensive operations. diff --git a/cajeh-backend/cajehform/config/cable.yml b/cajeh-backend/cajehform/config/cable.yml deleted file mode 100644 index 3c8b3e60b..000000000 --- a/cajeh-backend/cajehform/config/cable.yml +++ /dev/null @@ -1,10 +0,0 @@ -development: - adapter: async - -test: - adapter: test - -production: - adapter: redis - url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> - channel_prefix: cajehform_production diff --git a/cajeh-backend/cajehform/config/credentials.yml.enc b/cajeh-backend/cajehform/config/credentials.yml.enc deleted file mode 100644 index fea99342f..000000000 --- a/cajeh-backend/cajehform/config/credentials.yml.enc +++ /dev/null @@ -1 +0,0 @@ -npLWkiFKGIunI1EhFyAjVuRH4FC4UOTcKQp7O8k8fcpcNmoCE8XPIvF7WuXhrO0VwmepVg/QTwEqRbjNKVHjyiNlrgh17t1KSYZPDrNPoCH9GxFocnuVeXM8qBW7Aeex7BbLKzF2Ycbud/CJgBze5ZQmKxd9QO/p8GvMPpyaT7hf6tY+8D4LMqTuoSg4OndzHDLxi8sgsfBGHRMxJSrpc6Ofi1zG2lx/hmxeH+wb2Dv9c3LtvHO3ZmtC12WUwtSZWVE6i+jxiFgBQQyiq4Ip802l1zSti8Bh06QhbBKNCrAv868t0N9CGfqk4JcvzCnuYaE225Uhgw27Sc7LCkXvUIpjuWRoT0IuEHYux+8JqJHDXlAF16z47LY3BhGArvbZ+y18LRAY/rZ5/lix9yymndgHNk4GK/g/bEpl--1jwUlaeBK37ENQZC--lJo7SIShX90pVmapfdNmOw== \ No newline at end of file diff --git a/cajeh-backend/cajehform/config/database.yml b/cajeh-backend/cajehform/config/database.yml deleted file mode 100644 index 949622491..000000000 --- a/cajeh-backend/cajehform/config/database.yml +++ /dev/null @@ -1,18 +0,0 @@ -default: &default - adapter: postgresql - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 - username: postgres - password: postgres - -development: - <<: *default - database: cajeh_form_dev - -test: - <<: *default - database: cajeh_form_test - -production: - <<: *default - database: cajeh_form_prod diff --git a/cajeh-backend/cajehform/config/database.yml.sample b/cajeh-backend/cajehform/config/database.yml.sample deleted file mode 100644 index b5ce3c3d5..000000000 --- a/cajeh-backend/cajehform/config/database.yml.sample +++ /dev/null @@ -1,18 +0,0 @@ -default: &default - adapter: postgresql - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 - username: <%= ENV['PG_USERNAME'] %> # default: postgres - password: <%= ENV['PG_PASSWORD'] %> # default: postgres - -development: - <<: *default - database: cajeh_form_dev - -test: - <<: *default - database: cajeh_form_test - -production: - <<: *default - database: cajeh_form_prod diff --git a/cajeh-backend/cajehform/config/environment.rb b/cajeh-backend/cajehform/config/environment.rb deleted file mode 100644 index 426333bb4..000000000 --- a/cajeh-backend/cajehform/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the Rails application. -require_relative 'application' - -# Initialize the Rails application. -Rails.application.initialize! diff --git a/cajeh-backend/cajehform/config/environments/development.rb b/cajeh-backend/cajehform/config/environments/development.rb deleted file mode 100644 index 698f159d8..000000000 --- a/cajeh-backend/cajehform/config/environments/development.rb +++ /dev/null @@ -1,52 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports. - config.consider_all_requests_local = true - - # Enable/disable caching. By default caching is disabled. - # Run rails dev:cache to toggle caching. - if Rails.root.join('tmp', 'caching-dev.txt').exist? - config.cache_store = :memory_store - config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{2.days.to_i}" - } - else - config.action_controller.perform_caching = false - - config.cache_store = :null_store - end - - # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :local - - # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false - - config.action_mailer.perform_caching = false - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Highlight code that triggered database queries in logs. - config.active_record.verbose_query_logs = true - - - # Raises error for missing translations. - # config.action_view.raise_on_missing_translations = true - - # Use an evented file watcher to asynchronously detect changes in source code, - # routes, locales, etc. This feature depends on the listen gem. - config.file_watcher = ActiveSupport::EventedFileUpdateChecker -end diff --git a/cajeh-backend/cajehform/config/environments/production.rb b/cajeh-backend/cajehform/config/environments/production.rb deleted file mode 100644 index 85a37f3c7..000000000 --- a/cajeh-backend/cajehform/config/environments/production.rb +++ /dev/null @@ -1,105 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - - # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] - # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). - # config.require_master_key = true - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - - # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :local - - # Mount Action Cable outside main process or domain. - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # Use the lowest log level to ensure availability of diagnostic information - # when problems arise. - config.log_level = :debug - - # Prepend all log lines with the following tags. - config.log_tags = [ :request_id ] - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Use a real queuing backend for Active Job (and separate queues per environment). - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "cajehform_production" - - config.action_mailer.perform_caching = false - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new - - # Use a different logger for distributed setups. - # require 'syslog/logger' - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - - if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - end - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false - - # Inserts middleware to perform automatic connection switching. - # The `database_selector` hash is used to pass options to the DatabaseSelector - # middleware. The `delay` is used to determine how long to wait after a write - # to send a subsequent read to the primary. - # - # The `database_resolver` class is used by the middleware to determine which - # database is appropriate to use based on the time delay. - # - # The `database_resolver_context` class is used by the middleware to set - # timestamps for the last write to the primary. The resolver uses the context - # class timestamps to determine how long to wait before reading from the - # replica. - # - # By default Rails will store a last write timestamp in the session. The - # DatabaseSelector middleware is designed as such you can define your own - # strategy for connection switching and pass that into the middleware through - # these configuration options. - # config.active_record.database_selector = { delay: 2.seconds } - # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver - # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session -end diff --git a/cajeh-backend/cajehform/config/environments/test.rb b/cajeh-backend/cajehform/config/environments/test.rb deleted file mode 100644 index de83a778b..000000000 --- a/cajeh-backend/cajehform/config/environments/test.rb +++ /dev/null @@ -1,48 +0,0 @@ -# The test environment is used exclusively to run your application's -# test suite. You never need to work with it otherwise. Remember that -# your test database is "scratch space" for the test suite and is wiped -# and recreated between test runs. Don't rely on the data there! - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - config.cache_classes = false - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Configure public file server for tests with Cache-Control for performance. - config.public_file_server.enabled = true - config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{1.hour.to_i}" - } - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - config.cache_store = :null_store - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Store uploaded files on the local file system in a temporary directory. - config.active_storage.service = :test - - config.action_mailer.perform_caching = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - # Raises error for missing translations. - # config.action_view.raise_on_missing_translations = true -end diff --git a/cajeh-backend/cajehform/config/initializers/application_controller_renderer.rb b/cajeh-backend/cajehform/config/initializers/application_controller_renderer.rb deleted file mode 100644 index 89d2efab2..000000000 --- a/cajeh-backend/cajehform/config/initializers/application_controller_renderer.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# ActiveSupport::Reloader.to_prepare do -# ApplicationController.renderer.defaults.merge!( -# http_host: 'example.org', -# https: false -# ) -# end diff --git a/cajeh-backend/cajehform/config/initializers/backtrace_silencers.rb b/cajeh-backend/cajehform/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cdf3..000000000 --- a/cajeh-backend/cajehform/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/cajeh-backend/cajehform/config/initializers/cors.rb b/cajeh-backend/cajehform/config/initializers/cors.rb deleted file mode 100644 index 3b1c1b5ed..000000000 --- a/cajeh-backend/cajehform/config/initializers/cors.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Avoid CORS issues when API is called from the frontend app. -# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests. - -# Read more: https://github.com/cyu/rack-cors - -# Rails.application.config.middleware.insert_before 0, Rack::Cors do -# allow do -# origins 'example.com' -# -# resource '*', -# headers: :any, -# methods: [:get, :post, :put, :patch, :delete, :options, :head] -# end -# end diff --git a/cajeh-backend/cajehform/config/initializers/filter_parameter_logging.rb b/cajeh-backend/cajehform/config/initializers/filter_parameter_logging.rb deleted file mode 100644 index 4a994e1e7..000000000 --- a/cajeh-backend/cajehform/config/initializers/filter_parameter_logging.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] diff --git a/cajeh-backend/cajehform/config/initializers/inflections.rb b/cajeh-backend/cajehform/config/initializers/inflections.rb deleted file mode 100644 index ac033bf9d..000000000 --- a/cajeh-backend/cajehform/config/initializers/inflections.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff --git a/cajeh-backend/cajehform/config/initializers/mime_types.rb b/cajeh-backend/cajehform/config/initializers/mime_types.rb deleted file mode 100644 index dc1899682..000000000 --- a/cajeh-backend/cajehform/config/initializers/mime_types.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf diff --git a/cajeh-backend/cajehform/config/initializers/wrap_parameters.rb b/cajeh-backend/cajehform/config/initializers/wrap_parameters.rb deleted file mode 100644 index bbfc3961b..000000000 --- a/cajeh-backend/cajehform/config/initializers/wrap_parameters.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] -end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff --git a/cajeh-backend/cajehform/config/locales/en.yml b/cajeh-backend/cajehform/config/locales/en.yml deleted file mode 100644 index cf9b342d0..000000000 --- a/cajeh-backend/cajehform/config/locales/en.yml +++ /dev/null @@ -1,33 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# The following keys must be escaped otherwise they will not be retrieved by -# the default I18n backend: -# -# true, false, on, off, yes, no -# -# Instead, surround them with single quotes. -# -# en: -# 'true': 'foo' -# -# To learn more, please read the Rails Internationalization guide -# available at https://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" diff --git a/cajeh-backend/cajehform/config/puma.rb b/cajeh-backend/cajehform/config/puma.rb deleted file mode 100644 index 5ed443774..000000000 --- a/cajeh-backend/cajehform/config/puma.rb +++ /dev/null @@ -1,38 +0,0 @@ -# Puma can serve each request in a thread from an internal thread pool. -# The `threads` method setting takes two numbers: a minimum and maximum. -# Any libraries that use thread pools should be configured to match -# the maximum value specified for Puma. Default is set to 5 threads for minimum -# and maximum; this matches the default thread size of Active Record. -# -max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } -min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } -threads min_threads_count, max_threads_count - -# Specifies the `port` that Puma will listen on to receive requests; default is 3000. -# -port ENV.fetch("PORT") { 3000 } - -# Specifies the `environment` that Puma will run in. -# -environment ENV.fetch("RAILS_ENV") { "development" } - -# Specifies the `pidfile` that Puma will use. -pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } - -# Specifies the number of `workers` to boot in clustered mode. -# Workers are forked web server processes. If using threads and workers together -# the concurrency of the application would be max `threads` * `workers`. -# Workers do not work on JRuby or Windows (both of which do not support -# processes). -# -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } - -# Use the `preload_app!` method when specifying a `workers` number. -# This directive tells Puma to first boot the application and load code -# before forking the application. This takes advantage of Copy On Write -# process behavior so workers use less memory. -# -# preload_app! - -# Allow puma to be restarted by `rails restart` command. -plugin :tmp_restart diff --git a/cajeh-backend/cajehform/config/routes.rb b/cajeh-backend/cajehform/config/routes.rb deleted file mode 100644 index da79794b7..000000000 --- a/cajeh-backend/cajehform/config/routes.rb +++ /dev/null @@ -1,4 +0,0 @@ -Rails.application.routes.draw do - resources :users - # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html -end diff --git a/cajeh-backend/cajehform/config/spring.rb b/cajeh-backend/cajehform/config/spring.rb deleted file mode 100644 index db5bf1307..000000000 --- a/cajeh-backend/cajehform/config/spring.rb +++ /dev/null @@ -1,6 +0,0 @@ -Spring.watch( - ".ruby-version", - ".rbenv-vars", - "tmp/restart.txt", - "tmp/caching-dev.txt" -) diff --git a/cajeh-backend/cajehform/config/storage.yml b/cajeh-backend/cajehform/config/storage.yml deleted file mode 100644 index d32f76e8f..000000000 --- a/cajeh-backend/cajehform/config/storage.yml +++ /dev/null @@ -1,34 +0,0 @@ -test: - service: Disk - root: <%= Rails.root.join("tmp/storage") %> - -local: - service: Disk - root: <%= Rails.root.join("storage") %> - -# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) -# amazon: -# service: S3 -# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> -# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> -# region: us-east-1 -# bucket: your_own_bucket - -# Remember not to checkin your GCS keyfile to a repository -# google: -# service: GCS -# project: your_project -# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> -# bucket: your_own_bucket - -# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) -# microsoft: -# service: AzureStorage -# storage_account_name: your_account_name -# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> -# container: your_container_name - -# mirror: -# service: Mirror -# primary: local -# mirrors: [ amazon, google, microsoft ] diff --git a/cajeh-backend/cajehform/db/migrate/20191009180525_create_users.rb b/cajeh-backend/cajehform/db/migrate/20191009180525_create_users.rb deleted file mode 100644 index 8e48aa6d6..000000000 --- a/cajeh-backend/cajehform/db/migrate/20191009180525_create_users.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateUsers < ActiveRecord::Migration[6.0] - def change - create_table :users do |t| - t.string :email - t.string :password - t.string :name - t.string :phone_number - t.boolean :collab - t.boolean :leader - t.string :password_confirmation - - t.timestamps - end - end -end diff --git a/cajeh-backend/cajehform/db/schema.rb b/cajeh-backend/cajehform/db/schema.rb deleted file mode 100644 index 134ba0443..000000000 --- a/cajeh-backend/cajehform/db/schema.rb +++ /dev/null @@ -1,30 +0,0 @@ -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# This file is the source Rails uses to define your schema when running `rails -# db:schema:load`. When creating a new database, `rails db:schema:load` tends to -# be faster and is potentially less error prone than running all of your -# migrations from scratch. Old migrations may fail to apply correctly if those -# migrations use external dependencies or application code. -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 2019_10_09_180525) do - - # These are extensions that must be enabled in order to support this database - enable_extension "plpgsql" - - create_table "users", force: :cascade do |t| - t.string "email" - t.string "password" - t.string "name" - t.string "phone_number" - t.boolean "collab" - t.boolean "leader" - t.string "password_confirmation" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - end - -end diff --git a/cajeh-backend/cajehform/db/seeds.rb b/cajeh-backend/cajehform/db/seeds.rb deleted file mode 100644 index 1beea2acc..000000000 --- a/cajeh-backend/cajehform/db/seeds.rb +++ /dev/null @@ -1,7 +0,0 @@ -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). -# -# Examples: -# -# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) -# Character.create(name: 'Luke', movie: movies.first) diff --git a/cajeh-backend/cajehform/lib/tasks/.keep b/cajeh-backend/cajehform/lib/tasks/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/cajeh-backend/cajehform/log/.keep b/cajeh-backend/cajehform/log/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/cajeh-backend/cajehform/public/robots.txt b/cajeh-backend/cajehform/public/robots.txt deleted file mode 100644 index c19f78ab6..000000000 --- a/cajeh-backend/cajehform/public/robots.txt +++ /dev/null @@ -1 +0,0 @@ -# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/cajeh-backend/cajehform/spec/controllers/users_controller_spec.rb b/cajeh-backend/cajehform/spec/controllers/users_controller_spec.rb deleted file mode 100644 index d974e5b9e..000000000 --- a/cajeh-backend/cajehform/spec/controllers/users_controller_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -require 'rails_helper' - -RSpec.describe UsersController, type: :controller do - - let(:valid_attributes) { - skip("Add a hash of attributes valid for your model") - } - - let(:invalid_attributes) { - skip("Add a hash of attributes invalid for your model") - } - - let(:valid_session) { {} } - - describe "GET #index" do - it "returns a success response" do - user = User.create! valid_attributes - get :index, params: {}, session: valid_session - expect(response).to be_successful - end - end - - describe "GET #show" do - it "returns a success response" do - user = User.create! valid_attributes - get :show, params: {id: user.to_param}, session: valid_session - expect(response).to be_successful - end - end - - describe "POST #create" do - context "with valid params" do - it "creates a new User" do - expect { - post :create, params: {user: valid_attributes}, session: valid_session - }.to change(User, :count).by(1) - end - - it "renders a JSON response with the new user" do - - post :create, params: {user: valid_attributes}, session: valid_session - expect(response).to have_http_status(:created) - expect(response.content_type).to eq('application/json') - expect(response.location).to eq(user_url(User.last)) - end - end - - context "with invalid params" do - it "renders a JSON response with errors for the new user" do - - post :create, params: {user: invalid_attributes}, session: valid_session - expect(response).to have_http_status(:unprocessable_entity) - expect(response.content_type).to eq('application/json') - end - end - end - - describe "PUT #update" do - context "with valid params" do - let(:new_attributes) { - skip("Add a hash of attributes valid for your model") - } - - it "updates the requested user" do - user = User.create! valid_attributes - put :update, params: {id: user.to_param, user: new_attributes}, session: valid_session - user.reload - skip("Add assertions for updated state") - end - - it "renders a JSON response with the user" do - user = User.create! valid_attributes - - put :update, params: {id: user.to_param, user: valid_attributes}, session: valid_session - expect(response).to have_http_status(:ok) - expect(response.content_type).to eq('application/json') - end - end - - context "with invalid params" do - it "renders a JSON response with errors for the user" do - user = User.create! valid_attributes - - put :update, params: {id: user.to_param, user: invalid_attributes}, session: valid_session - expect(response).to have_http_status(:unprocessable_entity) - expect(response.content_type).to eq('application/json') - end - end - end - - describe "DELETE #destroy" do - it "destroys the requested user" do - user = User.create! valid_attributes - expect { - delete :destroy, params: {id: user.to_param}, session: valid_session - }.to change(User, :count).by(-1) - end - end - -end diff --git a/cajeh-backend/cajehform/spec/models/user_spec.rb b/cajeh-backend/cajehform/spec/models/user_spec.rb deleted file mode 100644 index 47a31bb43..000000000 --- a/cajeh-backend/cajehform/spec/models/user_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe User, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/cajeh-backend/cajehform/spec/rails_helper.rb b/cajeh-backend/cajehform/spec/rails_helper.rb deleted file mode 100644 index d73d80bd8..000000000 --- a/cajeh-backend/cajehform/spec/rails_helper.rb +++ /dev/null @@ -1,61 +0,0 @@ -# This file is copied to spec/ when you run 'rails generate rspec:install' -require 'spec_helper' -ENV['RAILS_ENV'] ||= 'test' -require File.expand_path('../../config/environment', __FILE__) -# Prevent database truncation if the environment is production -abort("The Rails environment is running in production mode!") if Rails.env.production? -require 'rspec/rails' -# Add additional requires below this line. Rails is not loaded until this point! - -# Requires supporting ruby files with custom matchers and macros, etc, in -# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are -# run as spec files by default. This means that files in spec/support that end -# in _spec.rb will both be required and run as specs, causing the specs to be -# run twice. It is recommended that you do not name files matching this glob to -# end with _spec.rb. You can configure this pattern with the --pattern -# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. -# -# The following line is provided for convenience purposes. It has the downside -# of increasing the boot-up time by auto-requiring all files in the support -# directory. Alternatively, in the individual `*_spec.rb` files, manually -# require only the support files necessary. -# -# Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f } - -# Checks for pending migrations and applies them before tests are run. -# If you are not using ActiveRecord, you can remove these lines. -begin - ActiveRecord::Migration.maintain_test_schema! -rescue ActiveRecord::PendingMigrationError => e - puts e.to_s.strip - exit 1 -end -RSpec.configure do |config| - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" - - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, remove the following line or assign false - # instead of true. - config.use_transactional_fixtures = true - - # RSpec Rails can automatically mix in different behaviours to your tests - # based on their file location, for example enabling you to call `get` and - # `post` in specs under `spec/controllers`. - # - # You can disable this behaviour by removing the line below, and instead - # explicitly tag your specs with their type, e.g.: - # - # RSpec.describe UsersController, :type => :controller do - # # ... - # end - # - # The different available types are documented in the features, such as in - # https://relishapp.com/rspec/rspec-rails/docs - config.infer_spec_type_from_file_location! - - # Filter lines from Rails gems in backtraces. - config.filter_rails_from_backtrace! - # arbitrary gems may also be filtered via: - # config.filter_gems_from_backtrace("gem name") -end diff --git a/cajeh-backend/cajehform/spec/requests/users_spec.rb b/cajeh-backend/cajehform/spec/requests/users_spec.rb deleted file mode 100644 index 8d6a01c5f..000000000 --- a/cajeh-backend/cajehform/spec/requests/users_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'rails_helper' - -RSpec.describe "Users", type: :request do - describe "GET /users" do - it "works! (now write some real specs)" do - get users_path - expect(response).to have_http_status(200) - end - end -end diff --git a/cajeh-backend/cajehform/spec/routing/users_routing_spec.rb b/cajeh-backend/cajehform/spec/routing/users_routing_spec.rb deleted file mode 100644 index 3659f8b3d..000000000 --- a/cajeh-backend/cajehform/spec/routing/users_routing_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require "rails_helper" - -RSpec.describe UsersController, type: :routing do - describe "routing" do - it "routes to #index" do - expect(:get => "/users").to route_to("users#index") - end - - it "routes to #show" do - expect(:get => "/users/1").to route_to("users#show", :id => "1") - end - - - it "routes to #create" do - expect(:post => "/users").to route_to("users#create") - end - - it "routes to #update via PUT" do - expect(:put => "/users/1").to route_to("users#update", :id => "1") - end - - it "routes to #update via PATCH" do - expect(:patch => "/users/1").to route_to("users#update", :id => "1") - end - - it "routes to #destroy" do - expect(:delete => "/users/1").to route_to("users#destroy", :id => "1") - end - end -end diff --git a/cajeh-backend/cajehform/spec/spec_helper.rb b/cajeh-backend/cajehform/spec/spec_helper.rb deleted file mode 100644 index ce33d66df..000000000 --- a/cajeh-backend/cajehform/spec/spec_helper.rb +++ /dev/null @@ -1,96 +0,0 @@ -# This file was generated by the `rails generate rspec:install` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause -# this file to always be loaded, without a need to explicitly require it in any -# files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need -# it. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. - config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. - config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. - mocks.verify_partial_doubles = true - end - - # This option will default to `:apply_to_host_groups` in RSpec 4 (and will - # have no way to turn it off -- the option exists only for backwards - # compatibility in RSpec 3). It causes shared context metadata to be - # inherited by the metadata hash of host groups and examples, rather than - # triggering implicit auto-inclusion in groups with matching metadata. - config.shared_context_metadata_behavior = :apply_to_host_groups - -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # This allows you to limit a spec run to individual examples or groups - # you care about by tagging them with `:focus` metadata. When nothing - # is tagged with `:focus`, all examples get run. RSpec also provides - # aliases for `it`, `describe`, and `context` that include `:focus` - # metadata: `fit`, `fdescribe` and `fcontext`, respectively. - config.filter_run_when_matching :focus - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode - config.disable_monkey_patching! - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = "doc" - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end -end diff --git a/cajeh-backend/cajehform/storage/.keep b/cajeh-backend/cajehform/storage/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/cajeh-backend/cajehform/tmp/.keep b/cajeh-backend/cajehform/tmp/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/cajeh-backend/cajehform/vendor/.keep b/cajeh-backend/cajehform/vendor/.keep deleted file mode 100644 index e69de29bb..000000000