forked from adhearsion/adhearsion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller_generator.feature
34 lines (28 loc) · 1.41 KB
/
controller_generator.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Feature: Adhearsion controller generator
In order to speed up development of an Adhearsion app
As an Adhearsion developer
I want to generate a controller and its tests
Scenario: Generate a controller and a test file
When I run `ahn create path/somewhere`
And I cd to "path/somewhere"
And I run `ahn generate controller TestController`
Then the following directories should exist:
| lib |
| spec |
And the following files should exist:
| lib/test_controller.rb |
| spec/test_controller_spec.rb |
And the file "lib/test_controller.rb" should contain "class TestController < Adhearsion::CallController"
And the file "spec/test_controller_spec.rb" should contain "describe TestController"
Scenario: Generate a controller with lower-case name
When I run `ahn create path/somewhere`
And I cd to "path/somewhere"
And I run `ahn generate controller test_controller`
Then the following directories should exist:
| lib |
| spec |
And the following files should exist:
| lib/test_controller.rb |
| spec/test_controller_spec.rb |
And the file "lib/test_controller.rb" should contain "class TestController < Adhearsion::CallController"
And the file "spec/test_controller_spec.rb" should contain "describe TestController"