Improve messagerie readability
This commit is contained in:
parent
410a12b966
commit
5c46db3b3d
5 changed files with 41 additions and 3 deletions
21
spec/helpers/commentaire_helper_spec.rb
Normal file
21
spec/helpers/commentaire_helper_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe CommentaireHelper, type: :helper do
|
||||
describe ".commentaire_is_from_me_class" do
|
||||
let(:commentaire) { create(:commentaire, email: "michel@pref.fr") }
|
||||
|
||||
subject { commentaire_is_from_me_class(commentaire, me) }
|
||||
|
||||
context "when commentaire is from me" do
|
||||
let(:me) { "michel@pref.fr" }
|
||||
|
||||
it { is_expected.to eq("from-me") }
|
||||
end
|
||||
|
||||
context "when commentaire is not from me" do
|
||||
let(:me) { "roger@usager.fr" }
|
||||
|
||||
it { is_expected.to eq nil }
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue