+
diff --git a/config/database.yml b/config/database.yml
index bbc24623..b5549280 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -17,14 +17,18 @@
default: &default
adapter: postgresql
encoding: unicode
+ host: secretaria_ppgi_db
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
+ username: test_user
+ password: test_pwd
development:
<<: *default
+ host: localhost
database: secretaria_ppgi_development
-
+
# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
@@ -58,7 +62,7 @@ development:
test:
<<: *default
database: secretaria_ppgi_test
-
+
# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index 4b828e80..c24f4038 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -12,3 +12,4 @@
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
+Rails.application.config.assets.precompile += %w( process.scss )
diff --git a/config/routes.rb b/config/routes.rb
index f33f7f68..37ea6b49 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,9 @@
# frozen_string_literal: true
Rails.application.routes.draw do
+ get 'process/index'
+ post 'process', to: 'process#create', as: 'process_creation'
+ delete 'process/:id', to: 'process#delete', as: 'process_delete'
get 'home/index'
devise_for :users
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
diff --git a/config/spring.rb b/config/spring.rb
index 9fa7863f..0195bbba 100644
--- a/config/spring.rb
+++ b/config/spring.rb
@@ -4,3 +4,11 @@
tmp/restart.txt
tmp/caching-dev.txt
].each { |path| Spring.watch(path) }
+Spring.after_fork do
+ if ENV['DEBUGGER_STORED_RUBYLIB']
+ ENV['DEBUGGER_STORED_RUBYLIB'].split(File::PATH_SEPARATOR).each do |path|
+ next unless path =~ /ruby-debug-ide/
+ load path + '/ruby-debug-ide/multiprocess/starter.rb'
+ end
+ end
+end
\ No newline at end of file
diff --git a/db/migrate/20191114162918_devise_create_users.rb b/db/migrate/20191114162918_devise_create_users.rb
index e4fe133a..7bce69b6 100644
--- a/db/migrate/20191114162918_devise_create_users.rb
+++ b/db/migrate/20191114162918_devise_create_users.rb
@@ -4,13 +4,18 @@ class DeviseCreateUsers < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
## Database authenticatable
- t.string :email, null: false, default: ""
+ t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
## Recoverable
- t.string :reset_password_token
+ t.string :reset_password_token
t.datetime :reset_password_sent_at
+ # information
+ t.string :registration
+ t.string :full_name
+ t.string :role
+
## Rememberable
t.datetime :remember_created_at
@@ -36,7 +41,7 @@ def change
t.timestamps null: false
end
- add_index :users, :email, unique: true
+ add_index :users, :email, unique: true
add_index :users, :reset_password_token, unique: true
# add_index :users, :confirmation_token, unique: true
# add_index :users, :unlock_token, unique: true
diff --git a/db/migrate/20191114163205_add_info_to_users.rb b/db/migrate/20191114163205_add_info_to_users.rb
deleted file mode 100644
index 4408c2cc..00000000
--- a/db/migrate/20191114163205_add_info_to_users.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-class AddInfoToUsers < ActiveRecord::Migration[5.2]
- def change
- add_column :users, :full_name, :string
- add_column :users, :registration, :string
- add_column :users, :role, :integer
- end
-end
diff --git a/db/migrate/20201113214441_create_requests.rb b/db/migrate/20201113214441_create_requests.rb
new file mode 100644
index 00000000..de9fb71f
--- /dev/null
+++ b/db/migrate/20201113214441_create_requests.rb
@@ -0,0 +1,11 @@
+class CreateRequests < ActiveRecord::Migration[5.2]
+ def change
+ create_table :requests do |t|
+ t.integer :request_type_id
+ t.integer :user_id
+ t.binary :documents
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116003547_create_request_types.rb b/db/migrate/20201116003547_create_request_types.rb
new file mode 100644
index 00000000..a8326f9d
--- /dev/null
+++ b/db/migrate/20201116003547_create_request_types.rb
@@ -0,0 +1,10 @@
+class CreateRequestTypes < ActiveRecord::Migration[5.2]
+ def change
+ create_table :request_types do |t|
+ t.string :name
+ t.string :label
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116015344_create_sources.rb b/db/migrate/20201116015344_create_sources.rb
new file mode 100644
index 00000000..71113b70
--- /dev/null
+++ b/db/migrate/20201116015344_create_sources.rb
@@ -0,0 +1,9 @@
+class CreateSources < ActiveRecord::Migration[5.2]
+ def change
+ create_table :sources do |t|
+ t.string :name
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116015420_create_process_statuses.rb b/db/migrate/20201116015420_create_process_statuses.rb
new file mode 100644
index 00000000..67f3f321
--- /dev/null
+++ b/db/migrate/20201116015420_create_process_statuses.rb
@@ -0,0 +1,9 @@
+class CreateProcessStatuses < ActiveRecord::Migration[5.2]
+ def change
+ create_table :process_statuses do |t|
+ t.string :title
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116015655_create_information.rb b/db/migrate/20201116015655_create_information.rb
new file mode 100644
index 00000000..78a88788
--- /dev/null
+++ b/db/migrate/20201116015655_create_information.rb
@@ -0,0 +1,10 @@
+class CreateInformation < ActiveRecord::Migration[5.2]
+ def change
+ create_table :information do |t|
+ t.string :title
+ t.text :content
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116021025_create_processos.rb b/db/migrate/20201116021025_create_processos.rb
new file mode 100644
index 00000000..397b00ae
--- /dev/null
+++ b/db/migrate/20201116021025_create_processos.rb
@@ -0,0 +1,12 @@
+class CreateProcessos < ActiveRecord::Migration[5.2]
+ def change
+ create_table :processos do |t|
+ t.integer :user_id
+ t.integer :process_status_id
+ t.string :sei_process_code
+ t.binary :documents
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116021642_create_user_notifications.rb b/db/migrate/20201116021642_create_user_notifications.rb
new file mode 100644
index 00000000..639e1ebd
--- /dev/null
+++ b/db/migrate/20201116021642_create_user_notifications.rb
@@ -0,0 +1,8 @@
+class CreateUserNotifications < ActiveRecord::Migration[5.2]
+ def change
+ create_table :user_notifications do |t|
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116023448_create_activity_types.rb b/db/migrate/20201116023448_create_activity_types.rb
new file mode 100644
index 00000000..5bd3eaeb
--- /dev/null
+++ b/db/migrate/20201116023448_create_activity_types.rb
@@ -0,0 +1,9 @@
+class CreateActivityTypes < ActiveRecord::Migration[5.2]
+ def change
+ create_table :activity_types do |t|
+ t.string :title
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116023515_create_notifications.rb b/db/migrate/20201116023515_create_notifications.rb
new file mode 100644
index 00000000..70c4b0ad
--- /dev/null
+++ b/db/migrate/20201116023515_create_notifications.rb
@@ -0,0 +1,10 @@
+class CreateNotifications < ActiveRecord::Migration[5.2]
+ def change
+ create_table :notifications_content do |t|
+ t.string :title
+ t.text :content
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116025101_create_wiki_entries.rb b/db/migrate/20201116025101_create_wiki_entries.rb
new file mode 100644
index 00000000..d4443592
--- /dev/null
+++ b/db/migrate/20201116025101_create_wiki_entries.rb
@@ -0,0 +1,11 @@
+class CreateWikiEntries < ActiveRecord::Migration[5.2]
+ def change
+ create_table :wiki_entries do |t|
+ t.string :title
+ t.text :content
+ t.binary :documents
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20201116025343_create_wiki_entry_comments.rb b/db/migrate/20201116025343_create_wiki_entry_comments.rb
new file mode 100644
index 00000000..f20f5557
--- /dev/null
+++ b/db/migrate/20201116025343_create_wiki_entry_comments.rb
@@ -0,0 +1,10 @@
+class CreateWikiEntryComments < ActiveRecord::Migration[5.2]
+ def change
+ create_table :wiki_entry_comments do |t|
+ t.integer :wiki_entry_id
+ t.text :content
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 96d61d72..0228e0cf 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,24 +10,100 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2019_11_14_163205) do
+ActiveRecord::Schema.define(version: 2020_11_16_025343) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
+ create_table "activity_types", force: :cascade do |t|
+ t.string "title"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "information", force: :cascade do |t|
+ t.string "title"
+ t.text "content"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "notifications_content", force: :cascade do |t|
+ t.string "title"
+ t.text "content"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "process_statuses", force: :cascade do |t|
+ t.string "title"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "processos", force: :cascade do |t|
+ t.integer "user_id"
+ t.integer "process_status_id"
+ t.string "sei_process_code"
+ t.binary "documents"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "request_types", force: :cascade do |t|
+ t.string "name"
+ t.string "label"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "requests", force: :cascade do |t|
+ t.integer "request_type_id"
+ t.integer "user_id"
+ t.binary "documents"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "sources", force: :cascade do |t|
+ t.string "name"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "user_notifications", force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
+ t.string "registration"
+ t.string "full_name"
+ t.string "role"
t.datetime "remember_created_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
- t.string "full_name"
- t.string "registration"
- t.integer "role"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
+ create_table "wiki_entries", force: :cascade do |t|
+ t.string "title"
+ t.text "content"
+ t.binary "documents"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "wiki_entry_comments", force: :cascade do |t|
+ t.integer "wiki_entry_id"
+ t.text "content"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
end
diff --git a/db/seeds.rb b/db/seeds.rb
index a5ddd2f6..cbb31774 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -11,4 +11,14 @@
User.create(full_name: "Administrador", email: "admin@admin.com", password: "admin123", role: "administrator", registration: "000000000")
User.create(full_name: "Secretário", email: "secretary@secretary.com", password: "admin123", role: "secretary", registration: "000000000")
User.create(full_name: "Professor", email: "professor@professor.com", password: "admin123", role: "professor", registration: "000000000")
-User.create(full_name: "Aluno", email: "student@student.com", password: "admin123", role: "student", registration: "000000000")
\ No newline at end of file
+User.create(full_name: "Aluno", email: "student@student.com", password: "admin123", role: "student", registration: "000000000")
+
+RequestType.create(name: "general", label: "Solicitação geral")
+RequestType.create(name: "enroll_payment", label: "Pagamento de inscrição")
+RequestType.create(name: "financial_assistance", label: "Auxílio financeiro")
+RequestType.create(name: "proficiency", label: "Proficiência")
+RequestType.create(name: "deadline_extension", label: "Prorrogação de prazo")
+RequestType.create(name: "qualification", label: "Qualificação")
+RequestType.create(name: "credits_transfer", label: "Aproveitamento de estudos")
+RequestType.create(name: "graduation_enrollment", label: "Matrícula de aluno de graduação")
+RequestType.create(name: "general_enrollment", label: "Matrículas gerais de alunos")
\ No newline at end of file
diff --git a/dbconfig/init.sql b/dbconfig/init.sql
new file mode 100644
index 00000000..a8a40e5a
--- /dev/null
+++ b/dbconfig/init.sql
@@ -0,0 +1,8 @@
+CREATE DATABASE secretaria_ppgi_development;
+GRANT ALL PRIVILEGES ON DATABASE secretaria_ppgi_development TO test_user;
+
+CREATE DATABASE secretaria_ppgi_test;
+GRANT ALL PRIVILEGES ON DATABASE secretaria_ppgi_test TO test_user;
+
+CREATE DATABASE secretaria_ppgi_production;
+GRANT ALL PRIVILEGES ON DATABASE secretaria_ppgi_production TO test_user;
diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml
new file mode 100644
index 00000000..647f662f
--- /dev/null
+++ b/docker-compose-dev.yaml
@@ -0,0 +1,37 @@
+version: "3.7"
+
+services:
+ secretaria_ppgi_db:
+ container_name: secretaria_ppgi_db
+ image: postgres
+ restart: always
+ environment:
+ POSTGRES_USER: test_user
+ POSTGRES_PASSWORD: test_pwd
+ ports:
+ - 5432:5432
+ volumes:
+ - ./dbconfig/init.sql:/docker-entrypoint-initdb.d/init.sql
+
+ eng_sw_2020_1_dev:
+ container_name: eng_sw_2020_1_dev
+ tty: true
+ build: ./
+ volumes:
+ - ./:/root/secretaria
+ image: eng_sw_image
+ working_dir: /root/secretaria
+ command: bash -c 'bin/rails db:migrate RAILS_ENV=test && rails server -b 0.0.0.0'
+ ports:
+ - 3000:3000
+ depends_on:
+ - secretaria_ppgi_db
+
+ adminer:
+ image: adminer
+ restart: always
+ ports:
+ - 8080:8080
+ environment:
+ POSTGRES_USER: test_user
+ POSTGRES_PASSWORD: test_pwd
diff --git a/docker-compose.yaml b/docker-compose.yaml
new file mode 100644
index 00000000..dab3b1af
--- /dev/null
+++ b/docker-compose.yaml
@@ -0,0 +1,31 @@
+version: "3.2"
+
+services:
+ secretaria_ppgi_db:
+ container_name: secretaria_ppgi_db
+ image: postgres:13
+ restart: always
+ environment:
+ POSTGRES_USER: test_user
+ POSTGRES_PASSWORD: test_pwd
+ volumes:
+ - ./dbconfig/init.sql:/docker-entrypoint-initdb.d/init.sql
+ logging:
+ driver: none
+
+ eng_sw_2020_1:
+ container_name: eng_sw_2020_1
+ tty: true
+ build: ./
+ image: eng_sw_image
+ environment:
+ SECRETARIA_PPGI_DATABASE_PASSWORD: example
+ volumes:
+ - ./:/secretaria/
+ ports:
+ - 3000:3000
+ command: bash -c "rake"
+ depends_on:
+ - secretaria_ppgi_db
+
+
\ No newline at end of file
diff --git a/features/Anexar_arquivos.feature b/features/Anexar_arquivos.feature
new file mode 100644
index 00000000..f1fd4997
--- /dev/null
+++ b/features/Anexar_arquivos.feature
@@ -0,0 +1,14 @@
+Funcionalidade: Como um secretário, eu gostaria de anexar arquivos ao cadastro de um novo processo para que eu possa disponibilizar informações sobre os processos.
+
+Cenário: Anexar arquivos válidos
+ Dado que todos os arquivos anexados são de formatos válidos
+ E eu sou secretário
+ Quando eu clicar para anexar arquivos
+ Então os arquivos serão anexados
+ E mostra uma mensagem de operação concluída
+
+Cenário: Anexar arquivos inválidos
+ Dado que pelo menos um arquivo anexado foi de formato não válido
+ E eu sou secretário
+ Quando eu clicar para anexar arquivos
+ Então mostra uma mensagem de erro
\ No newline at end of file
diff --git a/features/adicionar_processo_com_detalhes.feature b/features/adicionar_processo_com_detalhes.feature
new file mode 100644
index 00000000..127396e5
--- /dev/null
+++ b/features/adicionar_processo_com_detalhes.feature
@@ -0,0 +1,16 @@
+#language: pt
+
+Funcionalidade: Anexar arquivos ao processo
+ A fim de manter o processo com o máximo de informações
+ Como um secretário
+ Eu quero anexar arquivos a um processo corrente
+
+ Cenário: Secretário anexa arquivo válido
+ Dado um processo existente
+ Quando adiciono um arquivo 'file.pdf' ao processo
+ Então o processo deve constar com o novo arquivo 'file.pdf'
+
+ Cenário: Secretário anexa arquivo inválido
+ Dado um processo existente
+ Quando adiciono um arquivo 'file.exe' ao processo
+ Então o processo não deve constar o novo arquivo 'file.exe'
\ No newline at end of file
diff --git a/features/cadastrostatus.feature b/features/cadastrostatus.feature
new file mode 100644
index 00000000..0bd902e1
--- /dev/null
+++ b/features/cadastrostatus.feature
@@ -0,0 +1,25 @@
+#language: pt
+
+Funcionalidade: Como um secretário,
+ eu gostaria de cadastrar os possíveis status dos processos,
+ para que eu possa manter controle do fluxo dos processos
+
+ Contexto: Faço login como secretário
+ Dado que estou estou na página de secretário
+ E clico em "Cadastrar um Status"
+
+ Cenário: Cadastrar um Status (caminho feliz)
+ Dado que estou na pagina de cadastrar um status
+ Quando preencher em "Nome do Status:" com "Novo"
+ E seleciono "Média" em "Urgência:"
+ E clicar em "Concluir"
+ Então deveria estar de volta na pagina de cadastrar um status
+ E deveria aparecer "Status Cadastrado com sucesso!"
+
+ Cenario: Cadastrar um Status (caminho triste)
+ Dado que estou na pagina de cadastrar um status
+ Quando preencher em "Nome do Status:" com "Novo"
+ E clicar em "Concluir"
+ Então deveria estar de volta na pagina de secretário
+ E deveria aparecer "Erro ao Cadastrar Status!"
+
\ No newline at end of file
diff --git a/features/step_definitions/Anexar_arquivos.rb b/features/step_definitions/Anexar_arquivos.rb
new file mode 100644
index 00000000..e188de78
--- /dev/null
+++ b/features/step_definitions/Anexar_arquivos.rb
@@ -0,0 +1,27 @@
+Dado('que todos os arquivos anexados são de formatos válidos') do
+ pending # Write code here that turns the phrase above into concrete actions
+ end
+
+ Dado('eu sou secretário') do
+ pending # Write code here that turns the phrase above into concrete actions
+ end
+
+ Quando('eu clicar para anexar arquivos') do
+ pending # Write code here that turns the phrase above into concrete actions
+ end
+
+ Então('os arquivos serão anexados') do
+ pending # Write code here that turns the phrase above into concrete actions
+ end
+
+ Então('mostra uma mensagem de operação concluída') do
+ pending # Write code here that turns the phrase above into concrete actions
+ end
+
+ Dado('que pelo menos um arquivo anexado foi de formato não válido') do
+ pending # Write code here that turns the phrase above into concrete actions
+ end
+
+ Então('mostra uma mensagem de erro') do
+ pending # Write code here that turns the phrase above into concrete actions
+ end
\ No newline at end of file
diff --git a/features/step_definitions/adicionar_processo_com_detalhes.rb b/features/step_definitions/adicionar_processo_com_detalhes.rb
new file mode 100644
index 00000000..6be42949
--- /dev/null
+++ b/features/step_definitions/adicionar_processo_com_detalhes.rb
@@ -0,0 +1,22 @@
+def valid(file)
+ accepted_formats = [".txt", ".pdf", ".png", ".jpg"]
+ accepted_formats.include? File.extname(file)
+end
+
+Dado("um processo existente") do
+ @processo = {'id' => 1, 'files' => []}
+end
+
+Quando("adiciono um arquivo {string} ao processo") do |file|
+ if valid file
+ @processo['files'].append(file)
+ end
+end
+
+Então("o processo deve constar com o novo arquivo {string}") do |file|
+ expect(@processo['files']).to include('file.pdf')
+end
+
+Então("o processo não deve constar o novo arquivo {string}") do |file|
+ expect(@processo['files']).not_to include('file.exe')
+end
\ No newline at end of file
diff --git a/features/step_definitions/cadastrostatus_steps.rb b/features/step_definitions/cadastrostatus_steps.rb
new file mode 100644
index 00000000..31abd0a6
--- /dev/null
+++ b/features/step_definitions/cadastrostatus_steps.rb
@@ -0,0 +1,35 @@
+Dado('que estou estou na página de secretário') do |page_secretario|
+ visit path_to(page_secretario)
+end
+
+Dado('clico em {string}') do |string|
+ click_button(string)
+end
+
+Dado('que estou na pagina de cadastrar um status') do |page_cadastro_status|
+ visit path_to(page_cadastro_status)
+end
+
+Quando('preencher em {string} com {string2}') do |string, string2|
+ fill_in(string, :with => string2)
+end
+
+Quando('seleciono {string} em {string2}') do |string, string2|
+ select(string, :from => string2)
+end
+
+Quando('clicar em {string}') do |string|
+ click_button(string)
+end
+
+Então('deveria estar de volta na pagina de cadastrar um status') do |page_cadastro_status|
+ visit path_to(page_cadastro_status)
+end
+
+Então('deveria estar de volta na pagina de secretario') do |page_secretario|
+ visit path_to(page_secretario)
+end
+
+Então('deveria aparecer {string}') do |string|
+ @expected_message = string
+end
\ No newline at end of file
diff --git a/features/step_definitions/ver_processos_por_pessoa.rb b/features/step_definitions/ver_processos_por_pessoa.rb
new file mode 100644
index 00000000..b6443050
--- /dev/null
+++ b/features/step_definitions/ver_processos_por_pessoa.rb
@@ -0,0 +1,27 @@
+Dado('que estou estou na página de secretário') do |page_secretario|
+ visit path_to(page_secretario)
+end
+
+Dado('clico em {string}') do |string|
+ click_button(string)
+end
+
+Dado('que estou na pagina de busca por nome') do |page_search_name|
+ visit path_to(page_page_search_name)
+end
+
+Quando('preencher nome em {string} com {string2}') do |string, string2|
+ fill_in(string, :with => string2)
+end
+
+Então("o nome deve constar no db") do |string|
+expect(File.readlines(file).grep({string})
+end
+
+Então("o nome não deve constar no db") do |string|
+ expect(File.readlines(file).not_to grep({string})
+end
+
+Então("os processos de {string} devem constar") do |file|
+ @expected_message = @processo['files']
+ end
\ No newline at end of file
diff --git a/features/ver_processos_por_pessoa.feature b/features/ver_processos_por_pessoa.feature
new file mode 100644
index 00000000..c73e18e2
--- /dev/null
+++ b/features/ver_processos_por_pessoa.feature
@@ -0,0 +1,21 @@
+#language: pt
+
+Funcionalidade: Filtrar processos por pessoa
+
+ Como um secretário, para que eu possa ter informações durante um atendimento,
+ eu gostaria de ver todos os processos relacionados a uma pessoa
+
+ Contexto: Faço login como secretário
+ Dado que estou estou na página de secretário
+ E clico em "Consultar Processos" para ser direcionado
+ ao campo "Nome do Envolvido"
+
+ Cenário: Nome da pessoa não consta no sistema
+ Dado uma busca por nome
+ Quando pesquiso uma pessoa específica
+ Então deve surgir o aviso de que este nome não está no banco de dados
+
+ Cenário: Pessoa sem processos registrados
+ Dado uma busca por nome
+ Quando pesquiso uma pessoa específica
+ Então deve surgir o aviso de que este nome não contém processos registrados
\ No newline at end of file
diff --git a/package.json b/package.json
index 35eaf1ed..4278469d 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,7 @@
{
"name": "secretaria_ppgi",
"private": true,
- "dependencies": {}
+ "dependencies": {
+ "@fortawesome/fontawesome-free": "^5.15.1"
+ }
}
diff --git a/spec/controllers/process_controller_spec.rb b/spec/controllers/process_controller_spec.rb
new file mode 100644
index 00000000..63e88ce3
--- /dev/null
+++ b/spec/controllers/process_controller_spec.rb
@@ -0,0 +1,12 @@
+require 'rails_helper'
+
+RSpec.describe ProcessController, type: :controller do
+
+ describe "GET #index" do
+ it "returns http success" do
+ get :index
+ expect(response).to have_http_status(:success)
+ end
+ end
+
+end
diff --git a/spec/helpers/process_helper_spec.rb b/spec/helpers/process_helper_spec.rb
new file mode 100644
index 00000000..b97e971e
--- /dev/null
+++ b/spec/helpers/process_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'rails_helper'
+
+# Specs in this file have access to a helper object that includes
+# the ProcessHelper. For example:
+#
+# describe ProcessHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# expect(helper.concat_strings("this","that")).to eq("this that")
+# end
+# end
+# end
+RSpec.describe ProcessHelper, type: :helper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/activity_type_spec.rb b/spec/models/activity_type_spec.rb
new file mode 100644
index 00000000..d32fd2d7
--- /dev/null
+++ b/spec/models/activity_type_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe ActivityType, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
\ No newline at end of file
diff --git a/spec/models/information_spec.rb b/spec/models/information_spec.rb
new file mode 100644
index 00000000..d3a54bb0
--- /dev/null
+++ b/spec/models/information_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe Information, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb
new file mode 100644
index 00000000..bbdc6e00
--- /dev/null
+++ b/spec/models/notification_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe Notification, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/process_status_spec.rb b/spec/models/process_status_spec.rb
new file mode 100644
index 00000000..f3e83570
--- /dev/null
+++ b/spec/models/process_status_spec.rb
@@ -0,0 +1,25 @@
+require 'rails_helper'
+
+describe ProcessStatus, type: :model do
+ it "Valido quando nome esta presente" do
+ status = Status.new( title: 'Novo')
+ expect(status).to be_valid
+ end
+end
+
+describe ProcessStatus, type: :model do
+ it "Invalido sem o nome" do
+ status = Status.new( title: nil)
+ status.valid?
+ expect(status.errors[:title]).to include("Nao pode deixar espaço de nome em branco.")
+ end
+end
+
+describe ProcessStatus, type: :model do
+ it "Invalido caso ja exista um e-mail igual" do
+ status = Status.create( title: 'Em espera')
+ status = Status.new( title: 'Em espera')
+ status.valid?
+ expect(status.errors[:title]).to include('Status Repetido')
+ end
+end
\ No newline at end of file
diff --git a/spec/models/processo_spec.rb b/spec/models/processo_spec.rb
new file mode 100644
index 00000000..510e6660
--- /dev/null
+++ b/spec/models/processo_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe Processo, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
\ No newline at end of file
diff --git a/spec/models/question_spec.rb b/spec/models/question_spec.rb
new file mode 100644
index 00000000..221fe28d
--- /dev/null
+++ b/spec/models/question_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe Question, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
\ No newline at end of file
diff --git a/spec/models/question_topic_spec.rb b/spec/models/question_topic_spec.rb
new file mode 100644
index 00000000..929c1596
--- /dev/null
+++ b/spec/models/question_topic_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe QuestionTopic, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
\ No newline at end of file
diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb
new file mode 100644
index 00000000..8ccca08f
--- /dev/null
+++ b/spec/models/request_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe Request, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/source_spec.rb b/spec/models/source_spec.rb
new file mode 100644
index 00000000..60e6408f
--- /dev/null
+++ b/spec/models/source_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe Source, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/user_notification_spec.rb b/spec/models/user_notification_spec.rb
new file mode 100644
index 00000000..236d7729
--- /dev/null
+++ b/spec/models/user_notification_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe UserNotification, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/user_secretary_spec.rb b/spec/models/user_secretary_spec.rb
new file mode 100644
index 00000000..bb224a37
--- /dev/null
+++ b/spec/models/user_secretary_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe UserSecretary, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/wiki_entry_comment_spec.rb b/spec/models/wiki_entry_comment_spec.rb
new file mode 100644
index 00000000..6cda1c0d
--- /dev/null
+++ b/spec/models/wiki_entry_comment_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe WikiEntryComment, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
\ No newline at end of file
diff --git a/spec/models/wiki_entry_spec.rb b/spec/models/wiki_entry_spec.rb
new file mode 100644
index 00000000..3abb4dc3
--- /dev/null
+++ b/spec/models/wiki_entry_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe WikiEntry, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index b06351ba..305764ba 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -58,6 +58,15 @@
# Filter lines from Rails gems in backtraces.
config.filter_rails_from_backtrace!
+ config.use_transactional_fixtures = false
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")
end
+require 'shoulda/matchers'
+
+Shoulda::Matchers.configure do |config|
+ config.integrate do |with|
+ with.test_framework :rspec
+ with.library :rails
+ end
+end
\ No newline at end of file
diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb
new file mode 100644
index 00000000..84219341
--- /dev/null
+++ b/spec/support/database_cleaner.rb
@@ -0,0 +1,22 @@
+RSpec.configure do |config|
+
+ config.before(:suite) do
+ DatabaseCleaner.clean_with(:truncation)
+ end
+
+ config.before(:each) do
+ DatabaseCleaner.strategy = :transaction
+ end
+
+ config.before(:each, :js => true) do
+ DatabaseCleaner.strategy = :truncation
+ end
+
+ config.before(:each) do
+ DatabaseCleaner.start
+ end
+
+ config.after(:each) do
+ DatabaseCleaner.clean
+ end
+ end
\ No newline at end of file
diff --git a/spec/views/process/index.html.erb_spec.rb b/spec/views/process/index.html.erb_spec.rb
new file mode 100644
index 00000000..3bcdfae4
--- /dev/null
+++ b/spec/views/process/index.html.erb_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe "process/index.html.erb", type: :view do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/test/models/request_type_spec.rb b/test/models/request_type_spec.rb
new file mode 100644
index 00000000..55aef7d5
--- /dev/null
+++ b/test/models/request_type_spec.rb
@@ -0,0 +1,13 @@
+require 'rails_helper'
+
+RSpec.describe RequestType, type: :model do
+ allowed_types = %w[general enroll_payment financial_assistance proficiency deadline_extension qualification credits_transfer graduation_enrollment general_enrollment]
+ it "is seeded array matching expected types" do
+ found_types = []
+ a = RequestType.find_each do |req_type|
+ found_types.append(req_type.name)
+ end
+ puts(found_types)
+ expect(found_types).to match_array(allowed_types)
+ end
+end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 3ab84e3d..a478af3b 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,3 +1,4 @@
+
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
diff --git a/yarn.lock b/yarn.lock
new file mode 100644
index 00000000..01c5ff74
--- /dev/null
+++ b/yarn.lock
@@ -0,0 +1,8 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+"@fortawesome/fontawesome-free@^5.15.1":
+ version "5.15.1"
+ resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.1.tgz#ccfef6ddbe59f8fe8f694783e1d3eb88902dc5eb"
+ integrity sha512-OEdH7SyC1suTdhBGW91/zBfR6qaIhThbcN8PUXtXilY4GYnSBbVqOntdHbC1vXwsDnX0Qix2m2+DSU1J51ybOQ==