3
3
include RSpec ::Rails ::Matchers ::RenderTemplate
4
4
let ( :response ) { ActionDispatch ::TestResponse . new }
5
5
6
- def assert_template ( *) ; end # Stub method
7
-
8
6
context "given a hash" do
7
+ def assert_template ( *) ; end
9
8
it "delegates to assert_template" do
10
9
expect ( self ) . to receive ( :assert_template ) . with ( { :this => "hash" } , "this message" )
11
10
expect ( "response" ) . to send ( template_expectation , { :this => "hash" } , "this message" )
12
11
end
13
12
end
14
13
15
14
context "given a string" do
15
+ def assert_template ( *) ; end
16
16
it "delegates to assert_template" do
17
17
expect ( self ) . to receive ( :assert_template ) . with ( "this string" , "this message" )
18
18
expect ( "response" ) . to send ( template_expectation , "this string" , "this message" )
19
19
end
20
20
end
21
21
22
22
context "given a symbol" do
23
+ def assert_template ( *) ; end
23
24
it "converts to_s and delegates to assert_template" do
24
25
expect ( self ) . to receive ( :assert_template ) . with ( "template_name" , "this message" )
25
26
expect ( "response" ) . to send ( template_expectation , :template_name , "this message" )
@@ -28,6 +29,7 @@ def assert_template(*); end # Stub method
28
29
29
30
context "with should" do
30
31
context "when assert_template passes" do
32
+ def assert_template ( *) ; end
31
33
it "passes" do
32
34
expect do
33
35
expect ( response ) . to send ( template_expectation , "template_name" )
0 commit comments