GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Markaby patched to run on rails 2.0.2
Homepage: http://code.whytheluckystiff.net/markaby/
Clone URL: git://github.com/giraffesoft/markaby.git
 * lib/markaby/rails.rb: make flash work
 * test/rails_test.rb: test that it works
 * test/rails/markaby/create.mab: usage for test
 * Rakefile: shortcut for running the Rails tests


git-svn-id: http://code.whytheluckystiff.net/svn/markaby/trunk@95 
2c81c6a9-7b7e-da11-ae0f-006097933fb5
tec (author)
Tue Dec 05 14:47:29 -0800 2006
commit  0edc5073b86b398ad252c65dadda2affbd5e33f4
tree    62b5223765a93b128a882cb2684feac3b2bcb382
parent  648750327076249a7009ccce54385283b9cd60d8
...
32
33
34
 
 
 
 
 
 
 
 
35
...
32
33
34
35
36
37
38
39
40
41
42
43
0
@@ -32,3 +32,11 @@ desc "Start a Markaby-aware IRB session"
0
 task :irb do
0
   sh 'irb -I lib -r markaby -r markaby/kernel_method'
0
 end
0
+
0
+namespace :test do
0
+ desc ''
0
+ task :rails do
0
+ Dir.chdir '../../../'
0
+ sh 'rake test:plugins PLUGIN=markaby'
0
+ end
0
+end
0
\ No newline at end of file
...
33
34
35
 
 
 
 
36
37
38
...
33
34
35
36
37
38
39
40
41
42
0
@@ -33,6 +33,10 @@ module Markaby
0
   end
0
   
0
   class Builder
0
+ def flash(*args)
0
+ @helpers.controller.send(:flash, *args)
0
+ end
0
+
0
     # Emulate ERB to satisfy helpers like <tt>form_for</tt>.
0
     def _erbout
0
       @_erbout ||= FauxErbout.new(self)
...
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
0
@@ -1,3 +1,7 @@
0
+unless flash[:message].nil?
0
+ p { flash[:message] }
0
+end
0
+
0
 form_tag '/monkeys' do
0
   div {
0
     submit_tag 'Save'
...
13
14
15
 
16
17
18
...
76
77
78
79
 
80
81
82
 
83
84
...
13
14
15
16
17
18
19
...
77
78
79
 
80
81
82
83
84
85
86
0
@@ -13,6 +13,7 @@ class MarkabyController < ActionController::Base
0
   end
0
   
0
   def create
0
+ flash[:message] = 'Hello World'
0
   end
0
 
0
   def partial_rendering
0
@@ -76,9 +77,10 @@ class MarkabyOnRailsTest < Test::Unit::TestCase
0
     assert_equal @expected_monkey_names, @response.body
0
   end
0
 
0
- def test_rendering_that_uses_form_tag
0
+ def test_flash_and_form_tag
0
     process :create
0
     assert_response :success
0
     assert_select 'form div input[type=submit]', 1
0
+ assert_select 'p', 'Hello World'
0
   end
0
 end

Comments

    No one has commented yet.