@@ -31,22 +31,22 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
31
31
assert_instance_method :create , content do |m |
32
32
assert_match %r{@post = Post\. new\( post_params\) } , m
33
33
assert_match %r{@post\. save} , m
34
- assert_match %r{format\. html \{ redirect_to @post, notice: ' Post was successfully created\. ' \} } , m
34
+ assert_match %r{format\. html \{ redirect_to @post, notice: " Post was successfully created\. " \} } , m
35
35
assert_match %r{format\. json \{ render :show, status: :created, location: @post \} } , m
36
- assert_match %r{format\. html \{ render :new \} } , m
36
+ assert_match %r{format\. html \{ render :new, status: :unprocessable_entity \} } , m
37
37
assert_match %r{format\. json \{ render json: @post\. errors, status: :unprocessable_entity \} } , m
38
38
end
39
39
40
40
assert_instance_method :update , content do |m |
41
- assert_match %r{format\. html \{ redirect_to @post, notice: ' Post was successfully updated\. ' \} } , m
41
+ assert_match %r{format\. html \{ redirect_to @post, notice: " Post was successfully updated\. " \} } , m
42
42
assert_match %r{format\. json \{ render :show, status: :ok, location: @post \} } , m
43
- assert_match %r{format\. html \{ render :edit \} } , m
43
+ assert_match %r{format\. html \{ render :edit, status: :unprocessable_entity \} } , m
44
44
assert_match %r{format\. json \{ render json: @post.errors, status: :unprocessable_entity \} } , m
45
45
end
46
46
47
47
assert_instance_method :destroy , content do |m |
48
48
assert_match %r{@post\. destroy} , m
49
- assert_match %r{format\. html \{ redirect_to posts_url, notice: ' Post was successfully destroyed\. ' \} } , m
49
+ assert_match %r{format\. html \{ redirect_to posts_url, notice: " Post was successfully destroyed\. " \} } , m
50
50
assert_match %r{format\. json \{ head :no_content \} } , m
51
51
end
52
52
0 commit comments