ryana-plug_test 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -4
- data/lib/plug_test/app/config/initializers/plug_test.rb +1 -1
- data/plug_test.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -35,12 +35,9 @@ Whenever you want to test a helper just call:
|
|
35
35
|
|
36
36
|
pt_helper { [CODE YOU WANT TO TEST] }
|
37
37
|
|
38
|
-
The only caveat, is that due to a few isms of Rails, you have to structure your blocks so that an argument is passed into the block,
|
39
|
-
and all your helper methods use that as a receiver.
|
40
|
-
|
41
38
|
pt_helper will return the output of the call and setup your @response so you can do:
|
42
39
|
|
43
|
-
res = pt_helper {
|
40
|
+
res = pt_helper { link_to 'my link text', :action => 'test' }
|
44
41
|
assert_response :success
|
45
42
|
assert_select 'a', 'my link text'
|
46
43
|
assert(/my link text/.match(res))
|
@@ -9,7 +9,7 @@ module PlugTest
|
|
9
9
|
if @plug_test_text
|
10
10
|
@plug_test_answer = render_to_string(:inline => "<%=" + @plug_test_text + "%>")
|
11
11
|
elsif @plug_test_block
|
12
|
-
@plug_test_answer = @
|
12
|
+
@plug_test_answer = @template.instance_eval(&@plug_test_block)
|
13
13
|
else
|
14
14
|
raise 'You win -- Did you call this method directly?'
|
15
15
|
end
|
data/plug_test.gemspec
CHANGED