Merge branch 'develop' of ssh://37.187.249.111:2200/opt/git/tps into develop
This commit is contained in:
commit
017c90f7b6
12 changed files with 40 additions and 15 deletions
1
Gemfile
1
Gemfile
|
@ -68,6 +68,7 @@ group :test do
|
|||
gem 'shoulda-matchers', require: false
|
||||
gem 'simplecov', require: false
|
||||
gem 'poltergeist'
|
||||
gem 'timecop'
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
|
|
|
@ -292,6 +292,7 @@ GEM
|
|||
thor (0.19.1)
|
||||
thread_safe (0.3.5)
|
||||
tilt (1.4.1)
|
||||
timecop (0.7.3)
|
||||
turbolinks (2.5.3)
|
||||
coffee-rails
|
||||
tzinfo (1.2.2)
|
||||
|
@ -365,6 +366,7 @@ DEPENDENCIES
|
|||
simplecov
|
||||
spring
|
||||
spring-commands-rspec
|
||||
timecop
|
||||
turbolinks
|
||||
uglifier (>= 1.3.0)
|
||||
unicorn
|
||||
|
|
|
@ -2,6 +2,6 @@ class BackofficeController < ApplicationController
|
|||
|
||||
def index
|
||||
redirect_to(controller: '/gestionnaires/sessions', action: :new) unless gestionnaire_signed_in?
|
||||
@dossiers = Dossier.all.decorate
|
||||
end
|
||||
|
||||
end
|
|
@ -6,4 +6,8 @@ class DossierDecorator < Draper::Decorator
|
|||
rescue
|
||||
'dd/mm/YYYY'
|
||||
end
|
||||
|
||||
def last_update
|
||||
updated_at.localtime.strftime('%d/%m/%Y %H:%M')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
%th Dossier
|
||||
%th etat
|
||||
%th Date de mise à jour
|
||||
%row
|
||||
%td Demande de subventions
|
||||
%td dossier n°34 Demande de subvention
|
||||
%td Mise à jour
|
||||
%td 24/12/2015
|
||||
- @dossiers.each do |dossier|
|
||||
%tr
|
||||
%td= dossier.procedure.libelle
|
||||
%td= dossier.nom_projet
|
||||
%td Mise à jour
|
||||
%td= dossier.last_update
|
|
@ -78,3 +78,5 @@ fr:
|
|||
not_saved:
|
||||
one: "1 erreur a empêché ce(tte) %{resource} d'être sauvegardé(e) :"
|
||||
other: "%{count} erreurs ont empêché ce(tte) %{resource} d'être sauvegardé(e) :"
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class AddTimeStampToDossier < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :dossiers, :created_at, :datetime
|
||||
add_column :dossiers, :updated_at, :datetime
|
||||
add_column :dossiers, :created_at, :datetime, default: Time.now
|
||||
add_column :dossiers, :updated_at, :datetime, default: Time.now
|
||||
end
|
||||
end
|
||||
|
|
|
@ -47,8 +47,8 @@ ActiveRecord::Schema.define(version: 20150922110719) do
|
|||
t.boolean "dossier_termine"
|
||||
t.integer "procedure_id"
|
||||
t.date "date_previsionnelle"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "created_at", default: '2015-09-22 09:25:29'
|
||||
t.datetime "updated_at", default: '2015-09-22 09:25:29'
|
||||
end
|
||||
|
||||
add_index "dossiers", ["procedure_id"], name: "index_dossiers_on_procedure_id", using: :btree
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe DossierDecorator do
|
||||
let(:dossier) { create(:dossier) }
|
||||
subject { dossier.decorate }
|
||||
describe 'last_update' do
|
||||
subject { Timecop.freeze(Time.new(2015, 12, 24, 14, 10)) { super().last_update } }
|
||||
it { is_expected.to eq('24/12/2015 14:10') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
FactoryGirl.define do
|
||||
factory :procedure do
|
||||
libelle 'Demande de subvention'
|
||||
description 'Description demande de subvention'
|
||||
lien_demarche 'http://localhost'
|
||||
libelle 'Demande de subvention'
|
||||
description "Demande de subvention à l'intention des associations"
|
||||
|
||||
trait :with_two_type_de_piece_justificative do
|
||||
after(:build) do |procedure, _evaluator|
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'when gestionnaire come to /backoffice and is not authenticated' do
|
||||
let(:procedure) { create(:procedure) }
|
||||
let!(:dossier) { create(:dossier, procedure: procedure) }
|
||||
before do
|
||||
visit backoffice_path
|
||||
end
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'backoffice/index.html.haml', type: :view do
|
||||
let!(:procedure) { create(:procedure) }
|
||||
let!(:decorated_dossier) { create(:dossier, procedure: procedure).decorate }
|
||||
before do
|
||||
assign(:dossiers, [decorated_dossier])
|
||||
render
|
||||
end
|
||||
it { expect(rendered).to have_css('#backoffice') }
|
||||
|
||||
subject { rendered }
|
||||
it { is_expected.to have_css('#backoffice') }
|
||||
it { is_expected.to have_content('Demande de subvention') }
|
||||
it { is_expected.to have_content(procedure.libelle) }
|
||||
it { is_expected.to have_content(decorated_dossier.nom_projet) }
|
||||
it { is_expected.to have_content(decorated_dossier.last_update) }
|
||||
end
|
Loading…
Reference in a new issue