rspec-action_view 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/rspec-action_view.gemspec
CHANGED
@@ -22,7 +22,18 @@ describe 'My View extensions!' do
|
|
22
22
|
extend_view_with MyView
|
23
23
|
|
24
24
|
describe '#run_template' do
|
25
|
-
it "should assign Kristian to the local 'name' that is used in the erb" do
|
25
|
+
it "should assign Kristian to the local 'name' that is used in the erb and stub out a method on the view!" do
|
26
|
+
with_engine(:erb) do |e, view|
|
27
|
+
view.stubs(:host).returns 'localhost'
|
28
|
+
res = e.run_template(:locals => {:name => 'Kristian'}) {"<%= goodbye name %> host: <%= host %>"}
|
29
|
+
res.should match /Kristian/
|
30
|
+
res.should match /localhost/
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe '#run_template' do
|
36
|
+
it "should assign Kristian to the local 'name' that is used in the erb, using full locals hash" do
|
26
37
|
with_engine(:erb) do |e|
|
27
38
|
e.run_template(:locals => {:name => 'Kristian'}) {"<%= goodbye name %>"}.should match /Kristian/
|
28
39
|
end
|
@@ -30,7 +41,7 @@ describe 'My View extensions!' do
|
|
30
41
|
end
|
31
42
|
|
32
43
|
describe '#run_template_locals' do
|
33
|
-
it "should assign Kristian to the local 'name' that is used in the erb" do
|
44
|
+
it "should assign Kristian to the local 'name' that is used in the erb, using convenience hash for locals" do
|
34
45
|
with_engine(:erb) do |e|
|
35
46
|
e.run_template_locals :name => 'Kristian' do
|
36
47
|
%{<%= goodbye name %>}
|