File tree Expand file tree Collapse file tree
decidim-proposals/spec/system/amendable Expand file tree Collapse file tree Original file line number Diff line number Diff line change 311311
312312 context "when the user clicks on the accept button" do
313313 before do
314+ # For some reason, the reject button click can fail unless the page
315+ # is first scrolled to the amend button...?
316+ # Got the idea from:
317+ # https://stackoverflow.com/a/39103252
318+ page . scroll_to ( find ( ".card__amend-button" ) )
314319 click_link "Accept"
315320 end
316321
341346
342347 context "when the user clicks on the reject button" do
343348 before do
349+ # For some reason, the reject button click can fail unless the page
350+ # is first scrolled to the amend button...?
351+ # Got the idea from:
352+ # https://stackoverflow.com/a/39103252
353+ page . scroll_to ( find ( ".card__amend-button" ) )
344354 click_link "Reject"
345355 end
346356
349359 end
350360
351361 it "is changed the state of the emendation" do
352- expect ( page ) . to have_css ( ".alert" , text : "This amendment for the proposal #{ proposal . title } was rejected" )
362+ expect ( page ) . to have_css ( ".callout. alert" , text : "This amendment for the proposal #{ proposal . title } was rejected" )
353363 end
354364 end
355365 end
You can’t perform that action at this time.
0 commit comments