File: controller_specs.feature

package info (click to toggle)
ruby-rspec-rails 7.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,796 kB
  • sloc: ruby: 11,068; sh: 198; makefile: 6
file content (37 lines) | stat: -rw-r--r-- 1,248 bytes parent folder | download
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
35
36
37
Feature: Controller generator spec

  Scenario: Controller generator
    When I run `bundle exec rails generate controller posts`
    Then the features should pass
    Then the output should contain:
      """
            create  app/controllers/posts_controller.rb
            invoke  erb
            create    app/views/posts
            invoke  rspec
            create    spec/requests/posts_spec.rb
            invoke  helper
            create    app/helpers/posts_helper.rb
            invoke    rspec
            create      spec/helpers/posts_helper_spec.rb
      """

  Scenario: Controller generator with customized `default-path`
    Given a file named ".rspec" with:
      """
      --default-path behaviour
      """
    And I run `bundle exec rails generate controller posts`
    Then the features should pass
    Then the output should contain:
      """
            create  app/controllers/posts_controller.rb
            invoke  erb
            create    app/views/posts
            invoke  rspec
            create    behaviour/requests/posts_spec.rb
            invoke  helper
            create    app/helpers/posts_helper.rb
            invoke    rspec
            create      behaviour/helpers/posts_helper_spec.rb
      """