diff --git a/app/controllers/batch_lists_controller.rb b/app/controllers/batch_lists_controller.rb
new file mode 100644
index 0000000..6bfaa4d
--- /dev/null
+++ b/app/controllers/batch_lists_controller.rb
@@ -0,0 +1,70 @@
+class BatchListsController < ApplicationController
+ before_action :set_batch_list, only: %i[ show edit update destroy ]
+
+ # GET /batch_lists or /batch_lists.json
+ def index
+ @batch_lists = BatchList.all
+ end
+
+ # GET /batch_lists/1 or /batch_lists/1.json
+ def show
+ end
+
+ # GET /batch_lists/new
+ def new
+ @batch_list = BatchList.new
+ end
+
+ # GET /batch_lists/1/edit
+ def edit
+ end
+
+ # POST /batch_lists or /batch_lists.json
+ def create
+ @batch_list = BatchList.new(batch_list_params)
+
+ respond_to do |format|
+ if @batch_list.save
+ format.html { redirect_to batch_list_url(@batch_list), notice: "Batch list was successfully created." }
+ format.json { render :show, status: :created, location: @batch_list }
+ else
+ format.html { render :new, status: :unprocessable_entity }
+ format.json { render json: @batch_list.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PATCH/PUT /batch_lists/1 or /batch_lists/1.json
+ def update
+ respond_to do |format|
+ if @batch_list.update(batch_list_params)
+ format.html { redirect_to batch_list_url(@batch_list), notice: "Batch list was successfully updated." }
+ format.json { render :show, status: :ok, location: @batch_list }
+ else
+ format.html { render :edit, status: :unprocessable_entity }
+ format.json { render json: @batch_list.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /batch_lists/1 or /batch_lists/1.json
+ def destroy
+ @batch_list.destroy!
+
+ respond_to do |format|
+ format.html { redirect_to batch_lists_url, notice: "Batch list was successfully destroyed." }
+ format.json { head :no_content }
+ end
+ end
+
+ private
+ # Use callbacks to share common setup or constraints between actions.
+ def set_batch_list
+ @batch_list = BatchList.find(params[:id])
+ end
+
+ # Only allow a list of trusted parameters through.
+ def batch_list_params
+ params.require(:batch_list).permit(:gelombang, :aktif)
+ end
+end
diff --git a/app/controllers/source_information_lists_controller.rb b/app/controllers/source_information_lists_controller.rb
new file mode 100644
index 0000000..812a9ae
--- /dev/null
+++ b/app/controllers/source_information_lists_controller.rb
@@ -0,0 +1,70 @@
+class SourceInformationListsController < ApplicationController
+ before_action :set_source_information_list, only: %i[ show edit update destroy ]
+
+ # GET /source_information_lists or /source_information_lists.json
+ def index
+ @source_information_lists = SourceInformationList.all
+ end
+
+ # GET /source_information_lists/1 or /source_information_lists/1.json
+ def show
+ end
+
+ # GET /source_information_lists/new
+ def new
+ @source_information_list = SourceInformationList.new
+ end
+
+ # GET /source_information_lists/1/edit
+ def edit
+ end
+
+ # POST /source_information_lists or /source_information_lists.json
+ def create
+ @source_information_list = SourceInformationList.new(source_information_list_params)
+
+ respond_to do |format|
+ if @source_information_list.save
+ format.html { redirect_to source_information_list_url(@source_information_list), notice: "Source information list was successfully created." }
+ format.json { render :show, status: :created, location: @source_information_list }
+ else
+ format.html { render :new, status: :unprocessable_entity }
+ format.json { render json: @source_information_list.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PATCH/PUT /source_information_lists/1 or /source_information_lists/1.json
+ def update
+ respond_to do |format|
+ if @source_information_list.update(source_information_list_params)
+ format.html { redirect_to source_information_list_url(@source_information_list), notice: "Source information list was successfully updated." }
+ format.json { render :show, status: :ok, location: @source_information_list }
+ else
+ format.html { render :edit, status: :unprocessable_entity }
+ format.json { render json: @source_information_list.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /source_information_lists/1 or /source_information_lists/1.json
+ def destroy
+ @source_information_list.destroy!
+
+ respond_to do |format|
+ format.html { redirect_to source_information_lists_url, notice: "Source information list was successfully destroyed." }
+ format.json { head :no_content }
+ end
+ end
+
+ private
+ # Use callbacks to share common setup or constraints between actions.
+ def set_source_information_list
+ @source_information_list = SourceInformationList.find(params[:id])
+ end
+
+ # Only allow a list of trusted parameters through.
+ def source_information_list_params
+ params.require(:source_information_list).permit(:informasi)
+ end
+end
diff --git a/app/controllers/source_motivation_lists_controller.rb b/app/controllers/source_motivation_lists_controller.rb
new file mode 100644
index 0000000..a5018ff
--- /dev/null
+++ b/app/controllers/source_motivation_lists_controller.rb
@@ -0,0 +1,70 @@
+class SourceMotivationListsController < ApplicationController
+ before_action :set_source_motivation_list, only: %i[ show edit update destroy ]
+
+ # GET /source_motivation_lists or /source_motivation_lists.json
+ def index
+ @source_motivation_lists = SourceMotivationList.all
+ end
+
+ # GET /source_motivation_lists/1 or /source_motivation_lists/1.json
+ def show
+ end
+
+ # GET /source_motivation_lists/new
+ def new
+ @source_motivation_list = SourceMotivationList.new
+ end
+
+ # GET /source_motivation_lists/1/edit
+ def edit
+ end
+
+ # POST /source_motivation_lists or /source_motivation_lists.json
+ def create
+ @source_motivation_list = SourceMotivationList.new(source_motivation_list_params)
+
+ respond_to do |format|
+ if @source_motivation_list.save
+ format.html { redirect_to source_motivation_list_url(@source_motivation_list), notice: "Source motivation list was successfully created." }
+ format.json { render :show, status: :created, location: @source_motivation_list }
+ else
+ format.html { render :new, status: :unprocessable_entity }
+ format.json { render json: @source_motivation_list.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PATCH/PUT /source_motivation_lists/1 or /source_motivation_lists/1.json
+ def update
+ respond_to do |format|
+ if @source_motivation_list.update(source_motivation_list_params)
+ format.html { redirect_to source_motivation_list_url(@source_motivation_list), notice: "Source motivation list was successfully updated." }
+ format.json { render :show, status: :ok, location: @source_motivation_list }
+ else
+ format.html { render :edit, status: :unprocessable_entity }
+ format.json { render json: @source_motivation_list.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /source_motivation_lists/1 or /source_motivation_lists/1.json
+ def destroy
+ @source_motivation_list.destroy!
+
+ respond_to do |format|
+ format.html { redirect_to source_motivation_lists_url, notice: "Source motivation list was successfully destroyed." }
+ format.json { head :no_content }
+ end
+ end
+
+ private
+ # Use callbacks to share common setup or constraints between actions.
+ def set_source_motivation_list
+ @source_motivation_list = SourceMotivationList.find(params[:id])
+ end
+
+ # Only allow a list of trusted parameters through.
+ def source_motivation_list_params
+ params.require(:source_motivation_list).permit(:motivasi)
+ end
+end
diff --git a/app/helpers/batch_lists_helper.rb b/app/helpers/batch_lists_helper.rb
new file mode 100644
index 0000000..b3df7c3
--- /dev/null
+++ b/app/helpers/batch_lists_helper.rb
@@ -0,0 +1,2 @@
+module BatchListsHelper
+end
diff --git a/app/helpers/source_information_lists_helper.rb b/app/helpers/source_information_lists_helper.rb
new file mode 100644
index 0000000..56309fe
--- /dev/null
+++ b/app/helpers/source_information_lists_helper.rb
@@ -0,0 +1,2 @@
+module SourceInformationListsHelper
+end
diff --git a/app/helpers/source_motivation_lists_helper.rb b/app/helpers/source_motivation_lists_helper.rb
new file mode 100644
index 0000000..5942fd5
--- /dev/null
+++ b/app/helpers/source_motivation_lists_helper.rb
@@ -0,0 +1,2 @@
+module SourceMotivationListsHelper
+end
diff --git a/app/models/batch_list.rb b/app/models/batch_list.rb
index c9069fe..1b149ed 100644
--- a/app/models/batch_list.rb
+++ b/app/models/batch_list.rb
@@ -1,2 +1,9 @@
class BatchList < ApplicationRecord
+ validates :gelombang, presence: true, length: {minimum: 4, maximum: 25}, uniqueness: true
+ #aktif must boolean
+ validate :aktif_is_boolean
+ private
+ def aktif_is_boolean
+ errors.add(:aktif, "must be boolean") unless [true, false].include? aktif
+ end
end
diff --git a/app/models/source_information_list.rb b/app/models/source_information_list.rb
index 2be7383..70fa40b 100644
--- a/app/models/source_information_list.rb
+++ b/app/models/source_information_list.rb
@@ -1,2 +1,3 @@
class SourceInformationList < ApplicationRecord
+ validates :informasi, presence: true, length: {minimum: 4, maximum: 25}, uniqueness: true
end
diff --git a/app/models/source_motivation_list.rb b/app/models/source_motivation_list.rb
index a736099..2f56a0a 100644
--- a/app/models/source_motivation_list.rb
+++ b/app/models/source_motivation_list.rb
@@ -1,2 +1,3 @@
class SourceMotivationList < ApplicationRecord
+ validates :motivasi, presence: true, length: {minimum: 4, maximum: 20}, uniqueness: true
end
diff --git a/app/views/batch_lists/_batch_list.html.erb b/app/views/batch_lists/_batch_list.html.erb
new file mode 100644
index 0000000..6e5c96c
--- /dev/null
+++ b/app/views/batch_lists/_batch_list.html.erb
@@ -0,0 +1,12 @@
+
+
+ Gelombang:
+ <%= batch_list.gelombang %>
+
+
+
+ Aktif:
+ <%= batch_list.aktif %>
+
+
+
diff --git a/app/views/batch_lists/_batch_list.json.jbuilder b/app/views/batch_lists/_batch_list.json.jbuilder
new file mode 100644
index 0000000..56b1ff6
--- /dev/null
+++ b/app/views/batch_lists/_batch_list.json.jbuilder
@@ -0,0 +1,2 @@
+json.extract! batch_list, :id, :gelombang, :aktif, :created_at, :updated_at
+json.url batch_list_url(batch_list, format: :json)
diff --git a/app/views/batch_lists/_form.html.erb b/app/views/batch_lists/_form.html.erb
new file mode 100644
index 0000000..c90c112
--- /dev/null
+++ b/app/views/batch_lists/_form.html.erb
@@ -0,0 +1,27 @@
+<%= form_with(model: batch_list) do |form| %>
+ <% if batch_list.errors.any? %>
+
+
<%= pluralize(batch_list.errors.count, "error") %> prohibited this batch_list from being saved:
+
+
+ <% batch_list.errors.each do |error| %>
+ - <%= error.full_message %>
+ <% end %>
+
+
+ <% end %>
+
+
+ <%= form.label :gelombang, style: "display: block" %>
+ <%= form.text_field :gelombang %>
+
+
+
+ <%= form.label :aktif, style: "display: block" %>
+ <%= form.check_box :aktif %>
+
+
+
+ <%= form.submit %>
+
+<% end %>
diff --git a/app/views/batch_lists/edit.html.erb b/app/views/batch_lists/edit.html.erb
new file mode 100644
index 0000000..e052865
--- /dev/null
+++ b/app/views/batch_lists/edit.html.erb
@@ -0,0 +1,10 @@
+Editing batch list
+
+<%= render "form", batch_list: @batch_list %>
+
+
+
+
+ <%= link_to "Show this batch list", @batch_list %> |
+ <%= link_to "Back to batch lists", batch_lists_path %>
+
diff --git a/app/views/batch_lists/index.html.erb b/app/views/batch_lists/index.html.erb
new file mode 100644
index 0000000..89307a0
--- /dev/null
+++ b/app/views/batch_lists/index.html.erb
@@ -0,0 +1,14 @@
+<%= notice %>
+
+Batch lists
+
+
+ <% @batch_lists.each do |batch_list| %>
+ <%= render batch_list %>
+
+ <%= link_to "Show this batch list", batch_list %>
+
+ <% end %>
+
+
+<%= link_to "New batch list", new_batch_list_path %>
diff --git a/app/views/batch_lists/index.json.jbuilder b/app/views/batch_lists/index.json.jbuilder
new file mode 100644
index 0000000..abc3563
--- /dev/null
+++ b/app/views/batch_lists/index.json.jbuilder
@@ -0,0 +1 @@
+json.array! @batch_lists, partial: "batch_lists/batch_list", as: :batch_list
diff --git a/app/views/batch_lists/new.html.erb b/app/views/batch_lists/new.html.erb
new file mode 100644
index 0000000..60b26f2
--- /dev/null
+++ b/app/views/batch_lists/new.html.erb
@@ -0,0 +1,9 @@
+New batch list
+
+<%= render "form", batch_list: @batch_list %>
+
+
+
+
+ <%= link_to "Back to batch lists", batch_lists_path %>
+
diff --git a/app/views/batch_lists/show.html.erb b/app/views/batch_lists/show.html.erb
new file mode 100644
index 0000000..62aa8af
--- /dev/null
+++ b/app/views/batch_lists/show.html.erb
@@ -0,0 +1,10 @@
+<%= notice %>
+
+<%= render @batch_list %>
+
+
+ <%= link_to "Edit this batch list", edit_batch_list_path(@batch_list) %> |
+ <%= link_to "Back to batch lists", batch_lists_path %>
+
+ <%= button_to "Destroy this batch list", @batch_list, method: :delete %>
+
diff --git a/app/views/batch_lists/show.json.jbuilder b/app/views/batch_lists/show.json.jbuilder
new file mode 100644
index 0000000..f6bc0c6
--- /dev/null
+++ b/app/views/batch_lists/show.json.jbuilder
@@ -0,0 +1 @@
+json.partial! "batch_lists/batch_list", batch_list: @batch_list
diff --git a/app/views/source_information_lists/_form.html.erb b/app/views/source_information_lists/_form.html.erb
new file mode 100644
index 0000000..d6f3f22
--- /dev/null
+++ b/app/views/source_information_lists/_form.html.erb
@@ -0,0 +1,22 @@
+<%= form_with(model: source_information_list) do |form| %>
+ <% if source_information_list.errors.any? %>
+
+
<%= pluralize(source_information_list.errors.count, "error") %> prohibited this source_information_list from being saved:
+
+
+ <% source_information_list.errors.each do |error| %>
+ - <%= error.full_message %>
+ <% end %>
+
+
+ <% end %>
+
+
+ <%= form.label :informasi, style: "display: block" %>
+ <%= form.text_field :informasi %>
+
+
+
+ <%= form.submit %>
+
+<% end %>
diff --git a/app/views/source_information_lists/_source_information_list.html.erb b/app/views/source_information_lists/_source_information_list.html.erb
new file mode 100644
index 0000000..fbd9085
--- /dev/null
+++ b/app/views/source_information_lists/_source_information_list.html.erb
@@ -0,0 +1,7 @@
+
diff --git a/app/views/source_information_lists/_source_information_list.json.jbuilder b/app/views/source_information_lists/_source_information_list.json.jbuilder
new file mode 100644
index 0000000..ae5e855
--- /dev/null
+++ b/app/views/source_information_lists/_source_information_list.json.jbuilder
@@ -0,0 +1,2 @@
+json.extract! source_information_list, :id, :informasi, :created_at, :updated_at
+json.url source_information_list_url(source_information_list, format: :json)
diff --git a/app/views/source_information_lists/edit.html.erb b/app/views/source_information_lists/edit.html.erb
new file mode 100644
index 0000000..c84a241
--- /dev/null
+++ b/app/views/source_information_lists/edit.html.erb
@@ -0,0 +1,10 @@
+Editing source information list
+
+<%= render "form", source_information_list: @source_information_list %>
+
+
+
+
+ <%= link_to "Show this source information list", @source_information_list %> |
+ <%= link_to "Back to source information lists", source_information_lists_path %>
+
diff --git a/app/views/source_information_lists/index.html.erb b/app/views/source_information_lists/index.html.erb
new file mode 100644
index 0000000..fe7a671
--- /dev/null
+++ b/app/views/source_information_lists/index.html.erb
@@ -0,0 +1,14 @@
+<%= notice %>
+
+Source information lists
+
+
+
+<%= link_to "New source information list", new_source_information_list_path %>
diff --git a/app/views/source_information_lists/index.json.jbuilder b/app/views/source_information_lists/index.json.jbuilder
new file mode 100644
index 0000000..7c7a72c
--- /dev/null
+++ b/app/views/source_information_lists/index.json.jbuilder
@@ -0,0 +1 @@
+json.array! @source_information_lists, partial: "source_information_lists/source_information_list", as: :source_information_list
diff --git a/app/views/source_information_lists/new.html.erb b/app/views/source_information_lists/new.html.erb
new file mode 100644
index 0000000..41fbb37
--- /dev/null
+++ b/app/views/source_information_lists/new.html.erb
@@ -0,0 +1,9 @@
+New source information list
+
+<%= render "form", source_information_list: @source_information_list %>
+
+
+
+
+ <%= link_to "Back to source information lists", source_information_lists_path %>
+
diff --git a/app/views/source_information_lists/show.html.erb b/app/views/source_information_lists/show.html.erb
new file mode 100644
index 0000000..b69c63a
--- /dev/null
+++ b/app/views/source_information_lists/show.html.erb
@@ -0,0 +1,10 @@
+<%= notice %>
+
+<%= render @source_information_list %>
+
+
+ <%= link_to "Edit this source information list", edit_source_information_list_path(@source_information_list) %> |
+ <%= link_to "Back to source information lists", source_information_lists_path %>
+
+ <%= button_to "Destroy this source information list", @source_information_list, method: :delete %>
+
diff --git a/app/views/source_information_lists/show.json.jbuilder b/app/views/source_information_lists/show.json.jbuilder
new file mode 100644
index 0000000..c7c514b
--- /dev/null
+++ b/app/views/source_information_lists/show.json.jbuilder
@@ -0,0 +1 @@
+json.partial! "source_information_lists/source_information_list", source_information_list: @source_information_list
diff --git a/app/views/source_motivation_lists/_form.html.erb b/app/views/source_motivation_lists/_form.html.erb
new file mode 100644
index 0000000..e0daf4a
--- /dev/null
+++ b/app/views/source_motivation_lists/_form.html.erb
@@ -0,0 +1,22 @@
+<%= form_with(model: source_motivation_list) do |form| %>
+ <% if source_motivation_list.errors.any? %>
+
+
<%= pluralize(source_motivation_list.errors.count, "error") %> prohibited this source_motivation_list from being saved:
+
+
+ <% source_motivation_list.errors.each do |error| %>
+ - <%= error.full_message %>
+ <% end %>
+
+
+ <% end %>
+
+
+ <%= form.label :motivasi, style: "display: block" %>
+ <%= form.text_field :motivasi %>
+
+
+
+ <%= form.submit %>
+
+<% end %>
diff --git a/app/views/source_motivation_lists/_source_motivation_list.html.erb b/app/views/source_motivation_lists/_source_motivation_list.html.erb
new file mode 100644
index 0000000..7a23bd9
--- /dev/null
+++ b/app/views/source_motivation_lists/_source_motivation_list.html.erb
@@ -0,0 +1,7 @@
+
+
+ Motivasi:
+ <%= source_motivation_list.motivasi %>
+
+
+
diff --git a/app/views/source_motivation_lists/_source_motivation_list.json.jbuilder b/app/views/source_motivation_lists/_source_motivation_list.json.jbuilder
new file mode 100644
index 0000000..ed6850c
--- /dev/null
+++ b/app/views/source_motivation_lists/_source_motivation_list.json.jbuilder
@@ -0,0 +1,2 @@
+json.extract! source_motivation_list, :id, :motivasi, :created_at, :updated_at
+json.url source_motivation_list_url(source_motivation_list, format: :json)
diff --git a/app/views/source_motivation_lists/edit.html.erb b/app/views/source_motivation_lists/edit.html.erb
new file mode 100644
index 0000000..d812a1e
--- /dev/null
+++ b/app/views/source_motivation_lists/edit.html.erb
@@ -0,0 +1,10 @@
+Editing source motivation list
+
+<%= render "form", source_motivation_list: @source_motivation_list %>
+
+
+
+
+ <%= link_to "Show this source motivation list", @source_motivation_list %> |
+ <%= link_to "Back to source motivation lists", source_motivation_lists_path %>
+
diff --git a/app/views/source_motivation_lists/index.html.erb b/app/views/source_motivation_lists/index.html.erb
new file mode 100644
index 0000000..e7a9c1a
--- /dev/null
+++ b/app/views/source_motivation_lists/index.html.erb
@@ -0,0 +1,14 @@
+<%= notice %>
+
+Source motivation lists
+
+
+ <% @source_motivation_lists.each do |source_motivation_list| %>
+ <%= render source_motivation_list %>
+
+ <%= link_to "Show this source motivation list", source_motivation_list %>
+
+ <% end %>
+
+
+<%= link_to "New source motivation list", new_source_motivation_list_path %>
diff --git a/app/views/source_motivation_lists/index.json.jbuilder b/app/views/source_motivation_lists/index.json.jbuilder
new file mode 100644
index 0000000..9fa4716
--- /dev/null
+++ b/app/views/source_motivation_lists/index.json.jbuilder
@@ -0,0 +1 @@
+json.array! @source_motivation_lists, partial: "source_motivation_lists/source_motivation_list", as: :source_motivation_list
diff --git a/app/views/source_motivation_lists/new.html.erb b/app/views/source_motivation_lists/new.html.erb
new file mode 100644
index 0000000..178baee
--- /dev/null
+++ b/app/views/source_motivation_lists/new.html.erb
@@ -0,0 +1,9 @@
+New source motivation list
+
+<%= render "form", source_motivation_list: @source_motivation_list %>
+
+
+
+
+ <%= link_to "Back to source motivation lists", source_motivation_lists_path %>
+
diff --git a/app/views/source_motivation_lists/show.html.erb b/app/views/source_motivation_lists/show.html.erb
new file mode 100644
index 0000000..601b8e5
--- /dev/null
+++ b/app/views/source_motivation_lists/show.html.erb
@@ -0,0 +1,10 @@
+<%= notice %>
+
+<%= render @source_motivation_list %>
+
+
+ <%= link_to "Edit this source motivation list", edit_source_motivation_list_path(@source_motivation_list) %> |
+ <%= link_to "Back to source motivation lists", source_motivation_lists_path %>
+
+ <%= button_to "Destroy this source motivation list", @source_motivation_list, method: :delete %>
+
diff --git a/app/views/source_motivation_lists/show.json.jbuilder b/app/views/source_motivation_lists/show.json.jbuilder
new file mode 100644
index 0000000..446f128
--- /dev/null
+++ b/app/views/source_motivation_lists/show.json.jbuilder
@@ -0,0 +1 @@
+json.partial! "source_motivation_lists/source_motivation_list", source_motivation_list: @source_motivation_list
diff --git a/config/routes.rb b/config/routes.rb
index 754852d..6ee9ab0 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,4 +1,7 @@
Rails.application.routes.draw do
+ resources :source_motivation_lists
+ resources :source_information_lists
+ resources :batch_lists
resources :organization_degree_lists
resources :language_degree_lists
resources :language_name_lists
diff --git a/db/migrate/20240117033421_create_batch_lists.rb b/db/migrate/20240123231407_create_batch_lists.rb
similarity index 100%
rename from db/migrate/20240117033421_create_batch_lists.rb
rename to db/migrate/20240123231407_create_batch_lists.rb
diff --git a/db/schema.rb b/db/schema.rb
index 791ff27..be62ce2 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.1].define(version: 2024_01_23_041957) do
+ActiveRecord::Schema[7.1].define(version: 2024_01_23_231407) do
create_table "achievements", force: :cascade do |t|
t.string "nama_prestasi"
t.date "tahun"
diff --git a/test/controllers/batch_lists_controller_test.rb b/test/controllers/batch_lists_controller_test.rb
new file mode 100644
index 0000000..602b9ba
--- /dev/null
+++ b/test/controllers/batch_lists_controller_test.rb
@@ -0,0 +1,54 @@
+require "test_helper"
+
+class BatchListsControllerTest < ActionDispatch::IntegrationTest
+ setup do
+ get login_path
+ post login_path, params: {session: {
+ email: users(:michael).email, password: 'password'
+ }}
+ @batch_list = batch_lists(:one)
+ end
+
+ test "should get index" do
+ get batch_lists_url
+ assert_response :success
+ end
+
+ test "should get new" do
+ get new_batch_list_url
+ assert_response :success
+ end
+
+ test "should create batch_list" do
+ assert_difference("BatchList.count") do
+ post batch_lists_url, params:
+ { batch_list: { aktif: false, gelombang: 'usm 1' } }
+ end
+
+ assert_redirected_to batch_list_url(BatchList.last)
+ end
+
+ test "should show batch_list" do
+ get batch_list_url(@batch_list)
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get edit_batch_list_url(@batch_list)
+ assert_response :success
+ end
+
+ test "should update batch_list" do
+ patch batch_list_url(@batch_list),
+ params: { batch_list: { aktif: true, gelombang: 'pmdk medan' } }
+ assert_redirected_to batch_list_url(@batch_list)
+ end
+
+ test "should destroy batch_list" do
+ assert_difference("BatchList.count", -1) do
+ delete batch_list_url(@batch_list)
+ end
+
+ assert_redirected_to batch_lists_url
+ end
+end
diff --git a/test/controllers/source_information_lists_controller_test.rb b/test/controllers/source_information_lists_controller_test.rb
new file mode 100644
index 0000000..76184aa
--- /dev/null
+++ b/test/controllers/source_information_lists_controller_test.rb
@@ -0,0 +1,54 @@
+require "test_helper"
+
+class SourceInformationListsControllerTest < ActionDispatch::IntegrationTest
+ setup do
+ get login_path
+ post login_path, params: {session: {
+ email: users(:michael).email, password: 'password'
+ }}
+ @source_information_list = source_information_lists(:one)
+ end
+
+ test "should get index" do
+ get source_information_lists_url
+ assert_response :success
+ end
+
+ test "should get new" do
+ get new_source_information_list_url
+ assert_response :success
+ end
+
+ test "should create source_information_list" do
+ assert_difference("SourceInformationList.count") do
+ post source_information_lists_url,
+ params: { source_information_list: { informasi: 'radio' } }
+ end
+
+ assert_redirected_to source_information_list_url(SourceInformationList.last)
+ end
+
+ test "should show source_information_list" do
+ get source_information_list_url(@source_information_list)
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get edit_source_information_list_url(@source_information_list)
+ assert_response :success
+ end
+
+ test "should update source_information_list" do
+ patch source_information_list_url(@source_information_list),
+ params: { source_information_list: { informasi: 'promosi' } }
+ assert_redirected_to source_information_list_url(@source_information_list)
+ end
+
+ test "should destroy source_information_list" do
+ assert_difference("SourceInformationList.count", -1) do
+ delete source_information_list_url(@source_information_list)
+ end
+
+ assert_redirected_to source_information_lists_url
+ end
+end
diff --git a/test/controllers/source_motivation_lists_controller_test.rb b/test/controllers/source_motivation_lists_controller_test.rb
new file mode 100644
index 0000000..4127e5a
--- /dev/null
+++ b/test/controllers/source_motivation_lists_controller_test.rb
@@ -0,0 +1,54 @@
+require "test_helper"
+
+class SourceMotivationListsControllerTest < ActionDispatch::IntegrationTest
+ setup do
+ get login_path
+ post login_path, params: {session: {
+ email: users(:michael).email, password: 'password'
+ }}
+ @source_motivation_list = source_motivation_lists(:one)
+ end
+
+ test "should get index" do
+ get source_motivation_lists_url
+ assert_response :success
+ end
+
+ test "should get new" do
+ get new_source_motivation_list_url
+ assert_response :success
+ end
+
+ test "should create source_motivation_list" do
+ assert_difference("SourceMotivationList.count") do
+ post source_motivation_lists_url,
+ params: { source_motivation_list: { motivasi: 'pendidikan' } }
+ end
+
+ assert_redirected_to source_motivation_list_url(SourceMotivationList.last)
+ end
+
+ test "should show source_motivation_list" do
+ get source_motivation_list_url(@source_motivation_list)
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get edit_source_motivation_list_url(@source_motivation_list)
+ assert_response :success
+ end
+
+ test "should update source_motivation_list" do
+ patch source_motivation_list_url(@source_motivation_list),
+ params: { source_motivation_list: { motivasi: 'pekerjaan' } }
+ assert_redirected_to source_motivation_list_url(@source_motivation_list)
+ end
+
+ test "should destroy source_motivation_list" do
+ assert_difference("SourceMotivationList.count", -1) do
+ delete source_motivation_list_url(@source_motivation_list)
+ end
+
+ assert_redirected_to source_motivation_lists_url
+ end
+end
diff --git a/test/fixtures/batch_lists.yml b/test/fixtures/batch_lists.yml
index b43914e..cd1e444 100644
--- a/test/fixtures/batch_lists.yml
+++ b/test/fixtures/batch_lists.yml
@@ -1,9 +1,9 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
-#one:
-# gelombang: MyString
-# aktif: false
+one:
+ gelombang: MyString
+ aktif: false
-#two:
-# gelombang: MyString
-# aktif: false
+two:
+ gelombang: MyString
+ aktif: false
diff --git a/test/fixtures/source_information_lists.yml b/test/fixtures/source_information_lists.yml
index b53541f..d5349f0 100644
--- a/test/fixtures/source_information_lists.yml
+++ b/test/fixtures/source_information_lists.yml
@@ -1,7 +1,7 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
-#one:
-# informasi: MyString
+one:
+ informasi: MyString
-#two:
-# informasi: MyString
+two:
+ informasi: MyString
diff --git a/test/fixtures/source_motivation_lists.yml b/test/fixtures/source_motivation_lists.yml
index b957ad2..06271e6 100644
--- a/test/fixtures/source_motivation_lists.yml
+++ b/test/fixtures/source_motivation_lists.yml
@@ -1,7 +1,7 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
-#one:
-# motivasi: MyString
+one:
+ motivasi: MyString
-#two:
-# motivasi: MyString
+two:
+ motivasi: MyString
diff --git a/test/models/batch_list_test.rb b/test/models/batch_list_test.rb
index 5a9d951..9110650 100644
--- a/test/models/batch_list_test.rb
+++ b/test/models/batch_list_test.rb
@@ -1,7 +1,34 @@
require "test_helper"
class BatchListTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
+ def setup
+ @batch = BatchList.new(gelombang: 'pmdk sumut', aktif: true)
+ end
+ test "should accept valid gelombang" do
+ assert @batch.valid?
+ end
+ test "should reject for empty gelombang" do
+ @batch.gelombang = ' '
+ assert_not @batch.valid?
+ end
+ test "should reject for to short gelombang" do
+ @batch.gelombang ='a'*3
+ assert_not @batch.valid?
+ end
+ test "should reject for to long gelombang" do
+ @batch.gelombang = 'a'*26
+ assert_not @batch.valid?
+ end
+ test "should reject non unique gelombang" do
+ @batch.gelombang = batch_lists(:one).gelombang
+ assert_not @batch.valid?
+ end
+ test "should accept only boolean value" do
+ @batch.aktif = true
+ assert @batch.valid?
+ end
+ test "should reject for non boolean value for gelombang status" do
+ @batch.aktif = "done"
+ assert_not_equal 'done', @batch.aktif
+ end
end
diff --git a/test/models/source_information_list_test.rb b/test/models/source_information_list_test.rb
index b7e4965..8d8f802 100644
--- a/test/models/source_information_list_test.rb
+++ b/test/models/source_information_list_test.rb
@@ -1,7 +1,26 @@
require "test_helper"
class SourceInformationListTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
+ def setup
+ @source_info = SourceInformationList.new(informasi: 'koran sindo')
+ end
+ test "should accept the right source" do
+ assert @source_info.valid?
+ end
+ test "should reject for empty source" do
+ @source_info.informasi=' '
+ assert_not @source_info.valid?
+ end
+ test "should reject for too short source" do
+ @source_info.informasi= 'a'*3
+ assert_not @source_info.valid?
+ end
+ test "should reject for too long source" do
+ @source_info.informasi ='a'*26
+ assert_not @source_info.valid?
+ end
+ test "should reject for non unique source" do
+ @source_info.informasi = source_information_lists(:one)
+ assert_not @source_info.valid?
+ end
end
diff --git a/test/models/source_motivation_list_test.rb b/test/models/source_motivation_list_test.rb
index e2d1965..aa4581c 100644
--- a/test/models/source_motivation_list_test.rb
+++ b/test/models/source_motivation_list_test.rb
@@ -1,7 +1,26 @@
require "test_helper"
class SourceMotivationListTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
+ def setup
+ @motivation = SourceMotivationList.new(motivasi: 'koran sindo')
+ end
+ test "should accept the right source" do
+ assert @motivation.valid?
+ end
+ test "should reject for empty source" do
+ @motivation.motivasi=' '
+ assert_not @motivation.valid?
+ end
+ test "should reject for too short source" do
+ @motivation.motivasi= 'a'*3
+ assert_not @motivation.valid?
+ end
+ test "should reject for too long source" do
+ @motivation.motivasi ='a'*21
+ assert_not @motivation.valid?
+ end
+ test "should reject for non unique source" do
+ @motivation.motivasi = source_motivation_lists(:one)
+ assert_not @motivation.valid?
+ end
end
diff --git a/test/system/batch_lists_test.rb b/test/system/batch_lists_test.rb
new file mode 100644
index 0000000..f9fbea5
--- /dev/null
+++ b/test/system/batch_lists_test.rb
@@ -0,0 +1,43 @@
+require "application_system_test_case"
+
+class BatchListsTest < ApplicationSystemTestCase
+ setup do
+ @batch_list = batch_lists(:one)
+ end
+
+ test "visiting the index" do
+ visit batch_lists_url
+ assert_selector "h1", text: "Batch lists"
+ end
+
+ test "should create batch list" do
+ visit batch_lists_url
+ click_on "New batch list"
+
+ check "Aktif" if @batch_list.aktif
+ fill_in "Gelombang", with: @batch_list.gelombang
+ click_on "Create Batch list"
+
+ assert_text "Batch list was successfully created"
+ click_on "Back"
+ end
+
+ test "should update Batch list" do
+ visit batch_list_url(@batch_list)
+ click_on "Edit this batch list", match: :first
+
+ check "Aktif" if @batch_list.aktif
+ fill_in "Gelombang", with: @batch_list.gelombang
+ click_on "Update Batch list"
+
+ assert_text "Batch list was successfully updated"
+ click_on "Back"
+ end
+
+ test "should destroy Batch list" do
+ visit batch_list_url(@batch_list)
+ click_on "Destroy this batch list", match: :first
+
+ assert_text "Batch list was successfully destroyed"
+ end
+end
diff --git a/test/system/source_information_lists_test.rb b/test/system/source_information_lists_test.rb
new file mode 100644
index 0000000..216e28d
--- /dev/null
+++ b/test/system/source_information_lists_test.rb
@@ -0,0 +1,41 @@
+require "application_system_test_case"
+
+class SourceInformationListsTest < ApplicationSystemTestCase
+ setup do
+ @source_information_list = source_information_lists(:one)
+ end
+
+ test "visiting the index" do
+ visit source_information_lists_url
+ assert_selector "h1", text: "Source information lists"
+ end
+
+ test "should create source information list" do
+ visit source_information_lists_url
+ click_on "New source information list"
+
+ fill_in "Informasi", with: @source_information_list.informasi
+ click_on "Create Source information list"
+
+ assert_text "Source information list was successfully created"
+ click_on "Back"
+ end
+
+ test "should update Source information list" do
+ visit source_information_list_url(@source_information_list)
+ click_on "Edit this source information list", match: :first
+
+ fill_in "Informasi", with: @source_information_list.informasi
+ click_on "Update Source information list"
+
+ assert_text "Source information list was successfully updated"
+ click_on "Back"
+ end
+
+ test "should destroy Source information list" do
+ visit source_information_list_url(@source_information_list)
+ click_on "Destroy this source information list", match: :first
+
+ assert_text "Source information list was successfully destroyed"
+ end
+end
diff --git a/test/system/source_motivation_lists_test.rb b/test/system/source_motivation_lists_test.rb
new file mode 100644
index 0000000..2c47c84
--- /dev/null
+++ b/test/system/source_motivation_lists_test.rb
@@ -0,0 +1,41 @@
+require "application_system_test_case"
+
+class SourceMotivationListsTest < ApplicationSystemTestCase
+ setup do
+ @source_motivation_list = source_motivation_lists(:one)
+ end
+
+ test "visiting the index" do
+ visit source_motivation_lists_url
+ assert_selector "h1", text: "Source motivation lists"
+ end
+
+ test "should create source motivation list" do
+ visit source_motivation_lists_url
+ click_on "New source motivation list"
+
+ fill_in "Motivasi", with: @source_motivation_list.motivasi
+ click_on "Create Source motivation list"
+
+ assert_text "Source motivation list was successfully created"
+ click_on "Back"
+ end
+
+ test "should update Source motivation list" do
+ visit source_motivation_list_url(@source_motivation_list)
+ click_on "Edit this source motivation list", match: :first
+
+ fill_in "Motivasi", with: @source_motivation_list.motivasi
+ click_on "Update Source motivation list"
+
+ assert_text "Source motivation list was successfully updated"
+ click_on "Back"
+ end
+
+ test "should destroy Source motivation list" do
+ visit source_motivation_list_url(@source_motivation_list)
+ click_on "Destroy this source motivation list", match: :first
+
+ assert_text "Source motivation list was successfully destroyed"
+ end
+end