1
- require " rails/generators"
2
- require " generators/apidoco_generator"
3
- require " generator_spec"
1
+ require ' rails/generators'
2
+ require ' generators/apidoco_generator'
3
+ require ' generator_spec'
4
4
5
5
describe ApidocoGenerator , type : :generator do
6
6
def remove_docs_directory
@@ -12,20 +12,20 @@ def remove_docs_directory
12
12
end
13
13
14
14
context 'default actions' do
15
- it " creates a crud documentation files" do
15
+ it ' creates a crud documentation files' do
16
16
run_generator %w( api/v1/posts )
17
- assert_file "#{ Rails . root } /docs/api/v1/posts/create.json" , / api\ / v1\ / posts.json/
18
- assert_file "#{ Rails . root } /docs/api/v1/posts/destroy.json" , / api\ / v1\ / posts\ / :id.json/
19
- assert_file "#{ Rails . root } /docs/api/v1/posts/index.json" , / api\ / v1\ / posts.json/
20
- assert_file "#{ Rails . root } /docs/api/v1/posts/show.json" , / api\ / v1\ / posts\ / :id.json/
21
- assert_file "#{ Rails . root } /docs/api/v1/posts/update.json" , / api\ / v1\ / posts\ / :id.json/
17
+ assert_file "#{ Rails . root } /docs/api/v1/posts/create.json" , %r{ api/v1/posts.json}
18
+ assert_file "#{ Rails . root } /docs/api/v1/posts/destroy.json" , %r{ api/v1/posts/:id.json}
19
+ assert_file "#{ Rails . root } /docs/api/v1/posts/index.json" , %r{ api/v1/posts.json}
20
+ assert_file "#{ Rails . root } /docs/api/v1/posts/show.json" , %r{ api/v1/posts/:id.json}
21
+ assert_file "#{ Rails . root } /docs/api/v1/posts/update.json" , %r{ api/v1/posts/:id.json}
22
22
end
23
23
end
24
24
25
25
context 'custom actions' do
26
26
let ( :upload_acton ) { 'upload' }
27
27
28
- it " creates the documentation files for the actions supplied in arguments" do
28
+ it ' creates the documentation files for the actions supplied in arguments' do
29
29
run_generator [ 'api/v1/posts' , upload_acton ]
30
30
31
31
assert_file "#{ Rails . root } /docs/api/v1/posts/#{ upload_acton } .json"
0 commit comments