Skip to content

Commit

Permalink
updated spec for #59
Browse files Browse the repository at this point in the history
  • Loading branch information
catmando committed Jan 15, 2019
1 parent a2cf2c1 commit 4192c30
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@ class FooBar
it "can work with builtin events" do
mount 'Test' do
class Btn < HyperComponent
fires :bungo
fires :click
Btn.class.attr_accessor :clicked
render do
BUTTON(id: :btn) do
children.each(&:render)
end.on(:click) do |evt|
Btn.clicked = true
bungo!
click!
evt.stop_propagation
end
end
end
class Test < HyperComponent
render do
Btn { "CLICK ME" }.on(:bungo) { toggle :clicked } unless @clicked
Btn { "CLICK ME" }.on(:click) { toggle :clicked } unless @clicked
end
end
end
Expand Down
5 changes: 5 additions & 0 deletions ruby/hyper-router/spec/hyper-router/basic_dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
expect(page).to have_content('more on components...')
expect(page.current_path).to eq('/topics/components')
end

it 'a routers render method can return a string', skip: 'breaking - see issue #64' do
mount 'SimpleStringRouter'
expect(page).to have_content('a simple string')
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class SimpleStringRouter < HyperComponent
include Hyperstack::Router
render do
'a simple string'
end
end

0 comments on commit 4192c30

Please sign in to comment.