File tree Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change 6
6
before :all do
7
7
Rails . application . routes . append do
8
8
scope "page_rendering_components_spec" do
9
- get '/page_test ' , to : 'page_test #my_action' , as : 'rendering_page_test_action '
9
+ get '/page_rendering_test ' , to : 'page_rendering_test #my_action'
10
10
end
11
11
end
12
12
Rails . application . reload_routes!
13
+
14
+ class ExamplePageRendering < Matestack ::Ui ::Page
15
+ def response
16
+ div do
17
+ plain "ExamplePage"
18
+ end
19
+ end
20
+ end
21
+
22
+ class PageRenderingTestController < ActionController ::Base
23
+ include Matestack ::Ui ::Core ::Helper
24
+
25
+ def my_action
26
+ render ExamplePageRendering
27
+ end
28
+ end
13
29
end
14
30
15
- it "wraps page content with a specific dom structure"
31
+ before :each do
32
+ visit "page_rendering_components_spec/page_rendering_test"
33
+ end
34
+
35
+ it "wraps content with a specific dom structure" do
36
+ expect ( page ) . to have_xpath ( '//div[@id="matestack-ui"]/div[@class="matestack-page-container"]/div[@class="matestack-page-wrapper"]' )
37
+ end
16
38
39
+ it "renders its root element with a dynamic id composed of {controller} and {action}" do
40
+ expect ( page ) . to have_xpath ( '//div[@id="matestack-page-page-rendering-test-my-action"]' )
41
+ end
42
+
43
+ it "renders its root element with a specific class" do
44
+ expect ( page ) . to have_xpath ( '//div[@class="matestack-page-root"]' )
45
+ end
17
46
end
You can’t perform that action at this time.
0 commit comments