Mask draft files for user

This commit is contained in:
Xavier J 2015-11-20 17:50:54 +01:00
parent 27dedb1f7b
commit 4ff31f5f81
2 changed files with 4 additions and 3 deletions

View file

@ -2,7 +2,7 @@ class Users::DossiersController < UsersController
before_action :authenticate_user!
def index
@dossiers = current_user.dossiers.order(updated_at: 'DESC').decorate
@dossiers = current_user.dossiers.where("state NOT IN ('draft')").order(updated_at: 'DESC').decorate
end
def show

View file

@ -3,9 +3,10 @@ require 'spec_helper'
feature 'user access to the list of his dossier' do
let(:user) { create(:user) }
let!(:last_updated_dossier) { create(:dossier, :with_procedure, user: user)}
let!(:dossier1) { create(:dossier, :with_procedure, user: user, nom_projet: 'mon permier dossier') }
let!(:last_updated_dossier) { create(:dossier, :with_procedure, user: user, state: 'initiated')}
let!(:dossier1) { create(:dossier, :with_procedure, user: user, nom_projet: 'mon permier dossier', state: 'initiated') }
let!(:dossier2) { create(:dossier, :with_user, nom_projet: 'mon deuxième dossier') }
before do
last_updated_dossier.update_attributes(nom_projet: 'salut la compagnie')
visit root_path