Skip to content

Commit a66d0f3

Browse files
committed
Remove parens around assert statements
Ref #359
1 parent 554b648 commit a66d0f3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/scaffold_api_controller_generator_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ class ScaffoldApiControllerGeneratorTest < Rails::Generators::TestCase
3838
assert_match /@post\.destroy/, m
3939
end
4040

41-
assert_match(/def post_params/, content)
42-
assert_match(/params\.require\(:post\)\.permit\(:title, :body\)/, content)
41+
assert_match /def post_params/, content
42+
assert_match /params\.require\(:post\)\.permit\(:title, :body\)/, content
4343
end
4444
end
4545

4646
test 'dont use require and permit if there are no attributes' do
4747
run_generator %w(Post --api)
4848

4949
assert_file 'app/controllers/posts_controller.rb' do |content|
50-
assert_match(/def post_params/, content)
51-
assert_match(/params\.fetch\(:post, {}\)/, content)
50+
assert_match /def post_params/, content
51+
assert_match /params\.fetch\(:post, {}\)/, content
5252
end
5353
end
5454
end

test/scaffold_controller_generator_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
5050
assert_match /format\.json \{ head :no_content \}/, m
5151
end
5252

53-
assert_match(/def post_params/, content)
54-
assert_match(/params\.require\(:post\)\.permit\(:title, :body\)/, content)
53+
assert_match /def post_params/, content
54+
assert_match /params\.require\(:post\)\.permit\(:title, :body\)/, content
5555
end
5656
end
5757

5858
test 'dont use require and permit if there are no attributes' do
5959
run_generator %w(Post)
6060

6161
assert_file 'app/controllers/posts_controller.rb' do |content|
62-
assert_match(/def post_params/, content)
63-
assert_match(/params\.fetch\(:post, {}\)/, content)
62+
assert_match /def post_params/, content
63+
assert_match /params\.fetch\(:post, {}\)/, content
6464
end
6565
end
6666
end

0 commit comments

Comments
 (0)