@@ -48,14 +48,16 @@ def ordering
4848 collection_order_toggle key : :title do
4949 button do
5050 plain "title"
51- collection_order_toggle_indicator key : :title , asc : ' asc' , desc : ' desc'
51+ collection_order_toggle_indicator key : :title , default : ' created_at' , asc : ' asc' , desc : ' desc'
52+ # try line below
53+ # collection_order_toggle_indicator default: ' created_at', asc: ' asc', desc: ' desc'
5254 end
5355 end
5456 end
5557 end
5658
5759 def content
58- async rerender_on : "my-first-collection-update" do
60+ async id : 'my-collection' , rerender_on : "my-first-collection-update" do
5961 collection_content @my_collection . config do
6062 ul do
6163 @my_collection . paginated_data . each do |dummy |
@@ -72,11 +74,11 @@ def content
7274 end
7375
7476 visit "/example"
75- expect ( page ) . to have_button ( "title" )
77+ expect ( page ) . to have_button ( "title created_at " )
7678 expect ( all ( ".item" ) . first . text ) . to eq "some-title-1 some-description-1"
7779 expect ( all ( ".item" ) . last . text ) . to eq "some-title-11 some-description-11"
7880
79- click_button "title"
81+ click_button "title created_at "
8082 sleep 0.2 # otherwise getting stale element error, quick fix
8183 expect ( page ) . to have_button ( "title asc" )
8284 expect ( all ( ".item" ) . first . text ) . to eq "some-title-1 some-description-1"
@@ -90,16 +92,16 @@ def content
9092
9193 click_button "title desc"
9294 sleep 0.2 # otherwise getting stale element error, quick fix
93- expect ( page ) . to have_button ( "title" )
95+ expect ( page ) . to have_button ( "title created_at " )
9496 expect ( all ( ".item" ) . first . text ) . to eq "some-title-1 some-description-1"
9597 expect ( all ( ".item" ) . last . text ) . to eq "some-title-11 some-description-11"
9698
9799 # test persistent state
98100 page . driver . browser . navigate . refresh
99101 sleep 0.2 # otherwise getting stale element error, quick fix
100- expect ( page ) . to have_button ( "title" )
102+ expect ( page ) . to have_button ( "title created_at " )
101103 expect ( all ( ".item" ) . first . text ) . to eq "some-title-1 some-description-1"
102104 expect ( all ( ".item" ) . last . text ) . to eq "some-title-11 some-description-11"
103105 end
104106 end
105- end
107+ end
0 commit comments