Reorder a test to prepare for a future one

This commit is contained in:
Pierre de La Morinerie 2018-09-06 18:13:14 +02:00 committed by gregoirenovel
parent b4eb382e26
commit 968952ff46

View file

@ -1,20 +1,18 @@
require 'rails_helper'
RSpec.describe CommentaireHelper, type: :helper do
describe ".commentaire_is_from_me_class" do
let(:commentaire) { create(:commentaire, email: "michel@pref.fr") }
let(:commentaire) { create(:commentaire, email: "michel@pref.fr") }
describe ".commentaire_is_from_me_class" do
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