@@ -31,22 +31,22 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
3131 assert_instance_method :create , content do |m |
3232 assert_match %r{@post = Post\. new\( post_params\) } , m
3333 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
3535 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
3737 assert_match %r{format\. json \{ render json: @post\. errors, status: :unprocessable_entity \} } , m
3838 end
3939
4040 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
4242 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
4444 assert_match %r{format\. json \{ render json: @post.errors, status: :unprocessable_entity \} } , m
4545 end
4646
4747 assert_instance_method :destroy , content do |m |
4848 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
5050 assert_match %r{format\. json \{ head :no_content \} } , m
5151 end
5252
0 commit comments