@@ -110,17 +110,25 @@ def render_component(...)
110110
111111 context "with project" do
112112 let ( :project ) { project_red }
113- # these meetings from another project should not be visible
114- let! ( :other_project_meeting ) { create ( :meeting , project : project_blue , author :) }
113+ # this meeting from another project should not be visible
114+ let! ( :other_project_meeting ) do
115+ create ( :meeting , project : project_blue , author :, start_time : 1 . week . from_now , duration : 1 ) do |meeting |
116+ create ( :meeting_participant , meeting :, user : admin , invited : true )
117+ end
118+ end
115119
116120 context "with no meetings in this project" do
117121 it_behaves_like "empty-state with action"
118122 end
119123
120124 context "with meetings" do
121- let! ( :meeting_red ) { create ( :meeting , project : project_red , author :, start_time : 1 . week . from_now , duration : 1 ) }
125+ let! ( :meeting_red ) do
126+ create ( :meeting , project : project_red , author :, start_time : 1 . week . from_now , duration : 1 ) . tap do |meeting |
127+ create ( :meeting_participant , meeting :, user : admin , invited : true )
128+ end
129+ end
122130
123- it "renders only this project’s meetings" do
131+ it "renders only this project’s meetings which the user participates in " do
124132 expect ( rendered_component ) . to have_list_item ( count : 2 )
125133 expect ( rendered_component ) . to have_list_item ( position : 1 ) do |item |
126134 expect ( item ) . to have_link href : project_meeting_path ( project_red , meeting_red )
@@ -129,9 +137,7 @@ def render_component(...)
129137 end
130138
131139 expect ( rendered_component ) . to have_list_item ( position : 2 ) do |item |
132- expect ( item ) . to have_link href : project_meetings_path ( project_red ,
133- filters : [ { invited_user_id : { operator : "*" ,
134- values : [ ] } } ] . to_json )
140+ expect ( item ) . to have_link href : project_meetings_path ( project_red )
135141 expect ( item ) . to have_content ( "View all meetings" )
136142 end
137143 end
0 commit comments