Skip to content

Commit 9ca6489

Browse files
committed
adding spec for implicit rendering of custom actions
suggested by #303
1 parent 201122e commit 9ca6489

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

spec/matestack/ui/core/renderer_spec.rb

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,51 @@ def response
9494
end
9595
end
9696

97+
describe "implicit rendering for custom actions", type: :feature, js: true do
98+
before do
99+
module Clients
100+
end
101+
102+
class Clients::BookingsController < ApplicationController
103+
include Matestack::Ui::Core::ApplicationHelper
104+
105+
def step1
106+
end
107+
end
108+
109+
Rails.application.routes.draw do
110+
namespace :clients do
111+
get 'bookings/step1', to: 'bookings#step1'
112+
end
113+
end
114+
115+
class Apps::Clients < Matestack::Ui::App
116+
def response
117+
components {
118+
page_content
119+
}
120+
end
121+
end
122+
123+
module Pages::Clients
124+
end
125+
126+
class Pages::Clients::Bookings::Step1 < Matestack::Ui::Page
127+
def response
128+
components {
129+
plain "Hello from the Pages::Clients::Bookings::Step1 page."
130+
}
131+
end
132+
end
133+
end
134+
after do
135+
Rails.application.reload_routes!
136+
end
137+
specify do
138+
visit "/clients/bookings/step1"
139+
expect(page).to have_text "Hello from the Pages::Clients::Bookings::Step1 page."
140+
end
141+
end
142+
97143
end
98144
end

0 commit comments

Comments
 (0)