File tree 1 file changed +38
-0
lines changed
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 53
53
expect ( response ) . to be_successful
54
54
expect ( assigns ( :participant ) ) . to be_kind_of Participant
55
55
end
56
+
57
+ context "when logged in" do
58
+ context "when logged in user has not confirmed email" do
59
+ let ( :unconfirmed_email_participant ) { create ( :participant , email_confirmed_at : nil ) }
60
+
61
+ before do
62
+ activate_authlogic
63
+ ParticipantSession . create ( unconfirmed_email_participant )
64
+ end
65
+
66
+ it "should display confirm email flash message" do
67
+ get :show , params : { id : participant }
68
+ expect ( flash [ :alert ] ) . to be_present
69
+ end
70
+ end
71
+ end
72
+
73
+ context "when logged in user has confirmed email" do
74
+ let ( :unconfirmed_email_participant ) { create ( :participant , email_confirmed_at : Time . now ) }
75
+
76
+ before do
77
+ activate_authlogic
78
+ ParticipantSession . create ( unconfirmed_email_participant )
79
+ end
80
+
81
+ it "should not display confirm email flash message" do
82
+ get :show , params : { id : participant }
83
+ expect ( flash [ :alert ] ) . not_to be_present
84
+ end
85
+ end
86
+
87
+
88
+ context "when not logged in" do
89
+ it "should not show confirm email flash message" do
90
+ get :show , params : { id : participant }
91
+ expect ( flash [ :alert ] ) . not_to be_present
92
+ end
93
+ end
56
94
end
57
95
58
96
context "when the logged in user operates on someone elses record" do
You can’t perform that action at this time.
0 commit comments