Mask draft files for user
This commit is contained in:
parent
27dedb1f7b
commit
4ff31f5f81
2 changed files with 4 additions and 3 deletions
|
@ -2,7 +2,7 @@ class Users::DossiersController < UsersController
|
||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
|
|
||||||
def index
|
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
|
end
|
||||||
def show
|
def show
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,10 @@ require 'spec_helper'
|
||||||
feature 'user access to the list of his dossier' do
|
feature 'user access to the list of his dossier' do
|
||||||
|
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let!(:last_updated_dossier) { create(:dossier, :with_procedure, user: user)}
|
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') }
|
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') }
|
let!(:dossier2) { create(:dossier, :with_user, nom_projet: 'mon deuxième dossier') }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
last_updated_dossier.update_attributes(nom_projet: 'salut la compagnie')
|
last_updated_dossier.update_attributes(nom_projet: 'salut la compagnie')
|
||||||
visit root_path
|
visit root_path
|
||||||
|
|
Loading…
Reference in a new issue