File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ class ActiveAdmin::Views::Pages::Base
3
3
4
4
def build ( *args )
5
5
original_build ( args )
6
+ body = get_elements_by_tag_name ( "body" ) . first
6
7
body . set_attribute "data-default-select" , ActiveadminAddons . default_select
7
8
end
8
9
end
Original file line number Diff line number Diff line change 76
76
expect ( page ) . to have_selector ( "select.select2" )
77
77
end
78
78
end
79
+
80
+ context "when building ActiveAdmin html" do
81
+ describe "the <body> element" do
82
+ it "is present in the document only once" do
83
+ visit admin_invoices_path
84
+
85
+ expect ( page . all ( 'body' ) . size ) . to eq 1
86
+ end
87
+
88
+ it "contains the data-default-select attribute" do
89
+ visit admin_invoices_path
90
+
91
+ body = find ( "body" )
92
+ expect ( body [ 'data-default-select' ] ) . to eq ActiveadminAddons . default_select
93
+ end
94
+ end
95
+ end
79
96
end
You can’t perform that action at this time.
0 commit comments