File: named_routes.feature

package info (click to toggle)
ruby-rspec-rails 8.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,804 kB
  • sloc: ruby: 10,881; sh: 198; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Feature: Using named routes

  Routing specs have access to named routes.

  Scenario: Access named route
    Given a file named "spec/routing/widget_routes_spec.rb" with:
      """ruby
      require "rails_helper"

      RSpec.describe "routes to the widgets controller", type: :routing do
        it "routes a named route" do
          expect(:get => new_widget_path).
            to route_to(:controller => "widgets", :action => "new")
        end
      end
      """
    When I run `rspec spec`
    Then the examples should all pass